|
-
May 14th, 2011, 10:43 PM
#5
Re: RTF didn't show Unicode
Each piece of RTF text needs a corresponding Font + charset defined in the fonttbl each time there is a language change.
You can circumvent this by using default font "Arial Unicode MS" and fcharset0 to indicate that we are Unicode and not some other codepage.
Since you are inserting Rtf you can skip the MBCS convention and go exclusively with "\uNNNN?", where NNNN is the integer value in decimal.
ASCII Values < 128 can be left intact. You need to convert 128-255 to Unicode also so that any diacritics are properly encoded.
Here is an example of a multilanguage rtf using the above method. You can load this into Vb6 RichTextBox TextRTF Property and it should properly display all your strings:
{\rtf1\fbidis\ansi\deff0{\fonttbl
{\f0\fnil\fcharset0 Arial Unicode MS;}}
{\*\generator Msftedit 5.41.21.2509;}\viewkind4\uc1\pard\ltrpar\lang1033\f0\fs24
ARA: \rtlch\u1605?\u1600?\u1585?\u1581?\u1576?\u1600?\u1600?\u1575?\u1611?\ltrch\par
CHS: \u27426?\u-28722?\par
CHT: \u27489?\u-28722?\par
ENG: Welcome\par
GEO: \u4321?\u4304?\u4321?\u4323?\u4320?\u4309?\u4308?\u4314?\u4312?\par
GRK: \u922?\u945?\u955?\u974?\u962? \u942?\u955?\u952?\u945?\u964?\u949?\par
HEB: \rtlch\u1489?\u1512?\u1493?\u1499?\u1497?\u1501) \u1492?\u1489?\u1488?\u1497?\u1501?\ltrch\par
HIN: \u2352?\u2357?\u2366?\u2327?\u2340?\par
JPN: \u12424?\u12358?\u12371?\u12381?\par
KOR: \u-14868?\u-17164?\u-16072?\u-14700?\par
PTB: Bem-vindo\par
PUN: \u2588?\u2624? \u2566?\u2567?\u2566?\u2562? \u2600?\u2626?\u2672?\par
RUS: \u1044?\u1086?\u1073?\u1088?\u1086? \u1087?\u1086?\u1078?\u1072?\u1083?\u1086?\u1074?\u1072?\u1090?\u1100?\par
TAM: \u2949?\u2969?\u3021?\u2965?\u3007?\u2965?\u2992?\u3007?\par
THA: \u3585?\u3634?\u3619?\u3605?\u3657?\u3629?\u3609?\u3619?\u3633?\u3610?\par
URD: \u2360?\u2381?\u2357?\u2366?\u2327?\u2340?\par
VIE: tính t\u7915?\par
ARM: \u1329?\u1330?\u1331?\u1332?\u1333?\u1334?\u1335?\u1336?\u1337?\par
GER: Umlaute A\u776?I\u776?O\u776?\par
}
Last edited by DrUnicode; May 14th, 2011 at 10:59 PM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|