aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/UnicodeFromUTF8.h
diff options
context:
space:
mode:
authormitchell <unknown>2018-05-05 12:08:22 -0400
committermitchell <unknown>2018-05-05 12:08:22 -0400
commitad5951840a7e9d19c3652151e57466fa2c94e6a7 (patch)
treea77144132bd8fe505c8e0340e1e4e7d66d44bf07 /src/UnicodeFromUTF8.h
parent93462d87c3c8f398d5900be84349f29cb088d849 (diff)
downloadscintilla-mirror-ad5951840a7e9d19c3652151e57466fa2c94e6a7.tar.gz
Backport: Feature [feature-requests:#1212]. Move Unicode conversions into UniConversion.
Move Unicode conversion functions UnicodeFromUTF8 and UTF8FromUTF32Character into UniConversion. Backport of changeset 6645:463fa6965d9a.
Diffstat (limited to 'src/UnicodeFromUTF8.h')
-rw-r--r--src/UnicodeFromUTF8.h28
1 files changed, 0 insertions, 28 deletions
diff --git a/src/UnicodeFromUTF8.h b/src/UnicodeFromUTF8.h
deleted file mode 100644
index 17999a786..000000000
--- a/src/UnicodeFromUTF8.h
+++ /dev/null
@@ -1,28 +0,0 @@
-// Scintilla source code edit control
-/** @file UnicodeFromUTF8.h
- ** Lexer infrastructure.
- **/
-// Copyright 2013 by Neil Hodgson <neilh@scintilla.org>
-// This file is in the public domain.
-
-#ifndef UNICODEFROMUTF8_H
-#define UNICODEFROMUTF8_H
-
-namespace Scintilla {
-
-inline int UnicodeFromUTF8(const unsigned char *us) {
- if (us[0] < 0xC2) {
- return us[0];
- } else if (us[0] < 0xE0) {
- return ((us[0] & 0x1F) << 6) + (us[1] & 0x3F);
- } else if (us[0] < 0xF0) {
- return ((us[0] & 0xF) << 12) + ((us[1] & 0x3F) << 6) + (us[2] & 0x3F);
- } else if (us[0] < 0xF5) {
- return ((us[0] & 0x7) << 18) + ((us[1] & 0x3F) << 12) + ((us[2] & 0x3F) << 6) + (us[3] & 0x3F);
- }
- return us[0];
-}
-
-}
-
-#endif