1 // Copyright 2014 PDFium Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 6 7 #ifndef CORE_FXCRT_FX_CODEPAGE_H_ 8 #define CORE_FXCRT_FX_CODEPAGE_H_ 9 10 #include <stdint.h> 11 12 #define FX_CODEPAGE_DefANSI 0 13 #define FX_CODEPAGE_Symbol 42 14 #define FX_CODEPAGE_MSDOS_US 437 15 #define FX_CODEPAGE_Arabic_ASMO708 708 16 #define FX_CODEPAGE_MSDOS_Greek1 737 17 #define FX_CODEPAGE_MSDOS_Baltic 775 18 #define FX_CODEPAGE_MSDOS_WesternEuropean 850 19 #define FX_CODEPAGE_MSDOS_EasternEuropean 852 20 #define FX_CODEPAGE_MSDOS_Cyrillic 855 21 #define FX_CODEPAGE_MSDOS_Turkish 857 22 #define FX_CODEPAGE_MSDOS_Portuguese 860 23 #define FX_CODEPAGE_MSDOS_Icelandic 861 24 #define FX_CODEPAGE_MSDOS_Hebrew 862 25 #define FX_CODEPAGE_MSDOS_FrenchCanadian 863 26 #define FX_CODEPAGE_MSDOS_Arabic 864 27 #define FX_CODEPAGE_MSDOS_Norwegian 865 28 #define FX_CODEPAGE_MSDOS_Russian 866 29 #define FX_CODEPAGE_MSDOS_Greek2 869 30 #define FX_CODEPAGE_MSDOS_Thai 874 31 #define FX_CODEPAGE_ShiftJIS 932 32 #define FX_CODEPAGE_ChineseSimplified 936 33 #define FX_CODEPAGE_Hangul 949 34 #define FX_CODEPAGE_ChineseTraditional 950 35 #define FX_CODEPAGE_UTF16LE 1200 36 #define FX_CODEPAGE_UTF16BE 1201 37 #define FX_CODEPAGE_MSWin_EasternEuropean 1250 38 #define FX_CODEPAGE_MSWin_Cyrillic 1251 39 #define FX_CODEPAGE_MSWin_WesternEuropean 1252 40 #define FX_CODEPAGE_MSWin_Greek 1253 41 #define FX_CODEPAGE_MSWin_Turkish 1254 42 #define FX_CODEPAGE_MSWin_Hebrew 1255 43 #define FX_CODEPAGE_MSWin_Arabic 1256 44 #define FX_CODEPAGE_MSWin_Baltic 1257 45 #define FX_CODEPAGE_MSWin_Vietnamese 1258 46 #define FX_CODEPAGE_Johab 1361 47 #define FX_CODEPAGE_MAC_Roman 10000 48 #define FX_CODEPAGE_MAC_ShiftJIS 10001 49 #define FX_CODEPAGE_MAC_ChineseTraditional 10002 50 #define FX_CODEPAGE_MAC_Korean 10003 51 #define FX_CODEPAGE_MAC_Arabic 10004 52 #define FX_CODEPAGE_MAC_Hebrew 10005 53 #define FX_CODEPAGE_MAC_Greek 10006 54 #define FX_CODEPAGE_MAC_Cyrillic 10007 55 #define FX_CODEPAGE_MAC_ChineseSimplified 10008 56 #define FX_CODEPAGE_MAC_Thai 10021 57 #define FX_CODEPAGE_MAC_EasternEuropean 10029 58 #define FX_CODEPAGE_MAC_Turkish 10081 59 #define FX_CODEPAGE_UTF8 65001 60 61 #define FX_CHARSET_ANSI 0 62 #define FX_CHARSET_Default 1 63 #define FX_CHARSET_Symbol 2 64 #define FX_CHARSET_MAC_Roman 77 65 #define FX_CHARSET_MAC_ShiftJIS 78 66 #define FX_CHARSET_MAC_Korean 79 67 #define FX_CHARSET_MAC_ChineseSimplified 80 68 #define FX_CHARSET_MAC_ChineseTraditional 81 69 #define FX_CHARSET_MAC_Hebrew 83 70 #define FX_CHARSET_MAC_Arabic 84 71 #define FX_CHARSET_MAC_Greek 85 72 #define FX_CHARSET_MAC_Turkish 86 73 #define FX_CHARSET_MAC_Thai 87 74 #define FX_CHARSET_MAC_EasternEuropean 88 75 #define FX_CHARSET_MAC_Cyrillic 89 76 #define FX_CHARSET_ShiftJIS 128 77 #define FX_CHARSET_Hangul 129 78 #define FX_CHARSET_Johab 130 79 #define FX_CHARSET_ChineseSimplified 134 80 #define FX_CHARSET_ChineseTraditional 136 81 #define FX_CHARSET_MSWin_Greek 161 82 #define FX_CHARSET_MSWin_Turkish 162 83 #define FX_CHARSET_MSWin_Vietnamese 163 84 #define FX_CHARSET_MSWin_Hebrew 177 85 #define FX_CHARSET_MSWin_Arabic 178 86 #define FX_CHARSET_MSWin_Baltic 186 87 #define FX_CHARSET_MSWin_Cyrillic 204 88 #define FX_CHARSET_Thai 222 89 #define FX_CHARSET_MSWin_EasternEuropean 238 90 #define FX_CHARSET_US 254 91 #define FX_CHARSET_OEM 255 92 93 // Hi-bytes to unicode codepoint mapping for various code pages. 94 struct FX_CharsetUnicodes { 95 uint8_t m_Charset; 96 const uint16_t* m_pUnicodes; 97 }; 98 99 extern const FX_CharsetUnicodes g_FX_CharsetUnicodes[8]; 100 101 uint16_t FX_GetCodePageFromCharset(uint8_t charset); 102 uint8_t FX_GetCharsetFromCodePage(uint16_t codepage); 103 bool FX_CharSetIsCJK(uint8_t uCharset); 104 105 #endif // CORE_FXCRT_FX_CODEPAGE_H_ 106