]> git.saurik.com Git - wxWidgets.git/blame_incremental - src/stc/scintilla/src/UniConversion.h
wxMessageBox off the main thread lost result code.
[wxWidgets.git] / src / stc / scintilla / src / UniConversion.h
... / ...
CommitLineData
1// Scintilla source code edit control
2/** @file UniConversion.h
3 ** Functions to handle UTF-8 and UTF-16 strings.
4 **/
5// Copyright 1998-2001 by Neil Hodgson <neilh@scintilla.org>
6// The License.txt file describes the conditions under which this software may be distributed.
7
8const int UTF8MaxBytes = 4;
9
10unsigned int UTF8Length(const wchar_t *uptr, unsigned int tlen);
11void UTF8FromUTF16(const wchar_t *uptr, unsigned int tlen, char *putf, unsigned int len);
12unsigned int UTF8CharLength(unsigned char ch);
13unsigned int UTF16Length(const char *s, unsigned int len);
14unsigned int UTF16FromUTF8(const char *s, unsigned int len, wchar_t *tbuf, unsigned int tlen);
15
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);