From c9f2b4378d0f60fa71ffa7bdeb944295ee9cb153 Mon Sep 17 00:00:00 2001 From: skalogryz Date: Tue, 18 Nov 2014 06:06:49 +0000 Subject: [PATCH] richmemo: loading unicode characters git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3741 8e941d3f-bd1b-0410-a28a-d453659cc2b4 --- components/richmemo/richmemortf.pas | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/components/richmemo/richmemortf.pas b/components/richmemo/richmemortf.pas index 517947f19..b60809731 100644 --- a/components/richmemo/richmemortf.pas +++ b/components/richmemo/richmemortf.pas @@ -218,8 +218,18 @@ end; { TRTFMemoParserr } procedure TRTFMemoParser.classUnk; +var + txt : string; + ws : UnicodeString; begin //writelN('unk: ', rtfMajor, ' ',rtfMinor,' ', rtfParam,' ', GetRtfText); + txt:=GetRtfText; + if (length(txt)>2) and (txt[1]='\') and (txt[2]='u') and (txt[3] in ['0'..'9']) then begin + SetLength(Ws,1); + ws[1]:=UnicodeChar(rtfParam); + txtbuf:=txtbuf+UTF8Encode(ws); + txtlen:=length(txtbuf); + end; end; function CharToByte(const ch: AnsiChar): Byte;