📄 eb_charcodes.h
字号:
/************************************************
EB_CharCodes.h -
-------------------
begin : Tue Jun 13 2005
copyright : (C) 2004-2005 by DigitalAirways
email : info@digitalairways.com
***************************************************************************
*
* This software is the confidential and proprietary information of
* DigitalAirways, sarl. ("Confidential Information"). You shall not
* disclose such Confidential Information and shall use it only in
* accordance with the terms of the license agreement you entered into
* with DigitalAirways.
* A copy of this license is included in the licence.txt file included
* in this software package.
*
*/
/*
*/
#ifndef __EB_CHARCODES__
#define __EB_CHARCODES__
#include "EB_Utils.h"
#include "ConvertUTF.h"
/*
* This is useful stuff extracted from the official "ConverUTF" source
*/
#define UNI_SUR_HIGH_START (UTF32)0xD800
#define UNI_SUR_HIGH_END (UTF32)0xDBFF
#define UNI_SUR_LOW_START (UTF32)0xDC00
#define UNI_SUR_LOW_END (UTF32)0xDFFF
extern const UTF32 halfBase ;
extern const char trailingBytesForUTF8[256];
extern const UTF32 offsetsFromUTF8[6] ;
/*
* Utility routine to tell whether a sequence of bytes is legal UTF-8.
* This must be called with the length pre-determined by the first byte.
* If not calling this from ConvertUTF8to*, then the length can be set by:
* length = trailingBytesForUTF8[*source]+1;
* and the sequence is illegal right away if there aren't that many bytes
* available.
* If presented with a length > 4, this returns false. The Unicode
* definition of UTF-8 goes up to 4-byte sequences.
*/
KREBDLIBS_API bool isLegalUTF8(const UTF8 *source, int length);
/*
* This method returns a UTF16 character from a pointer on a
* UTF8 string.
* It returns 0 if the UTF8 string is not valid.
* If the UTF8 string is valid, "sourceIn" is updated to the first
* character that has NOT been used to compute the result.
* BEWARE : there is no way to check here that this function
* is not going to try to fetch bytes after the end of the valid
* part of "sourceIn"
* This function is using material from the official "ConvertUTF.c"
*/
KREBDLIBS_API UTF16 getUTF16fromUTF8(UTF8** sourceIn, ConversionFlags flags);
/*
* This method fills bufferOut with UTF8 characters converted from sourceIn that is
* containing iSourceInLen UTF16 characters.
* An additional \0 is added to the buffer.
* It returns the number of characters that have been inserted into bufferOut (not including
* the final \0)
*/
KREBDLIBS_API int fillUTF8fromUTF16(UTF16* sourceIn, int iSourceInLen, UTF8* bufferOut, int iBufferOutLen, ConversionFlags flags=strictConversion) ;
// used for mmi update
KREBDLIBS_API int countChars(unsigned short* text);
KREBDLIBS_API char* staticUTF16toUTF8(unsigned short* utf16, int len);
KREBDLIBS_API unsigned short* dynamicUTF8toUTF16(char* utf8String);
// end used for mmi update
#endif // __EB_CHARCODES__
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -