*CtrlCore: Fixed charset encoding issues in EncodeRTF, RichEdit: ClipZoom method

git-svn-id: svn://ultimatepp.org/upp/trunk@3323 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2011-04-05 14:03:51 +00:00
parent 7386be99a3
commit 82fdf80b01
6 changed files with 24 additions and 5 deletions

View file

@ -222,16 +222,14 @@ void RTFEncoder::Command(const char *cmd, int param)
void RTFEncoder::PutText(const wchar *text)
{
for(; *text; text++) {
if((uint16)*text >= 128) {
stream.Put(NFormat("\\u%d\\'%02x", (int16)*text, FromUnicode(*text, CHARSET_DEFAULT)));
}
for(; *text; text++)
if((uint16)*text >= 128)
stream.Put(NFormat("\\u%d?", (int16)*text));
else {
if(*text == '{' || *text == '}' || *text == '\\')
stream.Put('\\');
stream.Put((byte)*text);
}
}
}
void RTFEncoder::PutBinHex(const byte *b, int count)