]> git.saurik.com Git - wxWidgets.git/blame - src/stc/scintilla/src/UniConversion.h
wxMessageBox off the main thread lost result code.
[wxWidgets.git] / src / stc / scintilla / src / UniConversion.h
CommitLineData
65ec6247
RD
1// Scintilla source code edit control
2/** @file UniConversion.h
1dcf666d 3 ** Functions to handle UTF-8 and UTF-16 strings.
65ec6247
RD
4 **/
5// Copyright 1998-2001 by Neil Hodgson <neilh@scintilla.org>
f6bcfd97
BP
6// The License.txt file describes the conditions under which this software may be distributed.
7
1dcf666d
RD
8const int UTF8MaxBytes = 4;
9
f6bcfd97 10unsigned int UTF8Length(const wchar_t *uptr, unsigned int tlen);
7e0c58e9 11void UTF8FromUTF16(const wchar_t *uptr, unsigned int tlen, char *putf, unsigned int len);
1dcf666d 12unsigned int UTF8CharLength(unsigned char ch);
7e0c58e9
RD
13unsigned int UTF16Length(const char *s, unsigned int len);
14unsigned int UTF16FromUTF8(const char *s, unsigned int len, wchar_t *tbuf, unsigned int tlen);
f6bcfd97 15
1dcf666d
RD
16extern int UTF8BytesOfLead[256];
17void UTF8BytesOfLeadInitialise();
18
19inline bool UTF8IsTrailByte(int ch) {
20 return (ch >= 0x80) && (ch < 0xc0);
21}
22
23inline bool UTF8IsAscii(int ch) {
24 return ch < 0x80;
25}
26
27enum { UTF8MaskWidth=0x7, UTF8MaskInvalid=0x8 };
28int UTF8Classify(const unsigned char *us, int len);