From 0bb4d5456748c8794a943b4716ee089d0590519c Mon Sep 17 00:00:00 2001 From: Zufu Liu Date: Sat, 24 Mar 2018 13:53:22 +1100 Subject: Feature [feature-requests:#1212]. Move Unicode conversions into UniConversion. Move Unicode conversion functions UnicodeFromUTF8 and UTF8FromUTF32Character into UniConversion. --- src/UnicodeFromUTF8.h | 28 ---------------------------- 1 file changed, 28 deletions(-) delete mode 100644 src/UnicodeFromUTF8.h (limited to 'src/UnicodeFromUTF8.h') 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 -// 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 -- cgit v1.2.3