Core: Unicode support

git-svn-id: svn://ultimatepp.org/upp/trunk@11163 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2017-06-14 15:20:04 +00:00
parent 5f8f4e3a87
commit 1e09ad39fa
3 changed files with 56 additions and 12 deletions

View file

@ -2189,9 +2189,9 @@ void ConvertCharset(char *t, byte tcharset, const char *s, byte scharset, int n)
bool IsLetter(int c) { return (dword)c < 2048 ? uni__info[c] & 0xc0000000 : 0; }
bool IsUpper(int c) { return (dword)c < 2048 ? uni__info[c] & 0x40000000 : 0; }
bool IsLower(int c) { return (dword)c < 2048 ? uni__info[c] & 0x80000000 : 0; }
int ToUpper(int c) { return (dword)c < 2048 ? (uni__info[c] >> 11) & 2047 : c; }
int ToLower(int c) { return (dword)c < 2048 ? uni__info[c] & 2047 : c; }
int ToAscii(int c) { return (dword)c < 2048 ? (uni__info[c] >> 22) & 0x7f : 0; }
int ToUpper(int c) { return (dword)c < 2048 ? (uni__info[c] >> 11) & 2047 : ToUpperRest_(c); }
int ToLower(int c) { return (dword)c < 2048 ? uni__info[c] & 2047 : ToLowerRest_(c);; }
int ToAscii(int c) { return (dword)c < 2048 ? (uni__info[c] >> 22) & 0x7f : ToAsciiRest_(c); }
#endif
void ToUpper(wchar *t, const wchar *s, int len)

View file

@ -119,13 +119,16 @@ String ToCharset(byte charset, const String& s, byte scharset = CHARSET_DEFAULT
#ifndef flagSO
extern dword uni__info[2048];
dword ToUpperRest_(dword c);
dword ToLowerRest_(dword c);
dword ToAsciiRest_(dword c);
inline bool IsLetter(int c) { return (dword)c < 2048 ? uni__info[c] & 0xc0000000 : 0; }
inline bool IsUpper(int c) { return (dword)c < 2048 ? uni__info[c] & 0x40000000 : 0; }
inline bool IsLower(int c) { return (dword)c < 2048 ? uni__info[c] & 0x80000000 : 0; }
inline int ToUpper(int c) { return (dword)c < 2048 ? (uni__info[c] >> 11) & 2047 : c; }
inline int ToLower(int c) { return (dword)c < 2048 ? uni__info[c] & 2047 : c; }
inline int ToAscii(int c) { return (dword)c < 2048 ? (uni__info[c] >> 22) & 0x7f : 0; }
inline int ToUpper(int c) { return (dword)c < 2048 ? (uni__info[c] >> 11) & 2047 : ToUpperRest_(c); }
inline int ToLower(int c) { return (dword)c < 2048 ? uni__info[c] & 2047 : ToLowerRest_(c); }
inline int ToAscii(int c) { return (dword)c < 2048 ? (uni__info[c] >> 22) & 0x7f : ToAsciiRest_(c); }
#else
bool IsLetter(int c);
bool IsUpper(int c);

File diff suppressed because one or more lines are too long