"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "stoolkit/SUtil.cpp" between
yudit-3.0.1.tar.gz and yudit-3.0.2.tar.gz

About: yudit is an Unicode plain-text editor that can do True Type font rendering, printing, transliterated keyboard input and handwriting recognition with no dependencies on external engines.

SUtil.cpp  (yudit-3.0.1):SUtil.cpp  (yudit-3.0.2)
skipping to change at line 581 skipping to change at line 581
} }
trans = SString((char*)&array[ctoffs], ctlen); trans = SString((char*)&array[ctoffs], ctlen);
break; break;
} }
} }
moCache->put (str, trans); moCache->put (str, trans);
return SString(trans); return SString(trans);
} }
/** /**
* print the unicode value in "U+XXXX or U+XXXXXXXX" form * print the unicode value in XXXX or XXXXX or XXXXXXform
*/ */
SString SString
unicodeValueOf (const SV_UCS4& ucs4) unicodeValueOf (const SV_UCS4& ucs4)
{ {
char a[64]; char a[64];
SString s; SString s;
for (unsigned int i=0; i<ucs4.size(); i++) for (unsigned int i=0; i<ucs4.size(); i++)
{ {
if (i!=0) s.append (" "); if (ucs4[i] <= 0xffff) {
if (ucs4[i] > 0xffff) sprintf (a, "%04X", (unsigned int) ucs4[i]);
{ } else if (ucs4[i] <= 0xfffff) {
sprintf (a, "%08lX", (unsigned long) ucs4[i]); sprintf (a, "%05X", (unsigned int) ucs4[i]);
} } else if (ucs4[i] <= 0xffffff) {
else sprintf (a, "%06X", (unsigned int) ucs4[i]);
{ } else if (ucs4[i] <= 0xfffffff) {
sprintf (a, "%04X", (unsigned int) ucs4[i]); sprintf (a, "%07X", (unsigned int) ucs4[i]);
} else {
sprintf (a, "%08X", (unsigned int) ucs4[i]);
} }
if (i!=0) s.append (" ");
s.append (a); s.append (a);
} }
return SString (s); return SString (s);
} }
SString SString
unicodeValueOf (const SString& str) unicodeValueOf (const SString& str)
{ {
SEncoder enc("utf-8"); SEncoder enc("utf-8");
 End of changes. 3 change blocks. 
9 lines changed or deleted 12 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)