@@ -1104,6 +1104,30 @@ static uint8_t pm_encoding_windows_1258_table[256] = {
11041104 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , // Fx
11051105};
11061106
1107+ /**
1108+ * Each element of the following table contains a bitfield that indicates a
1109+ * piece of information about the corresponding windows-874 character.
1110+ */
1111+ static uint8_t pm_encoding_windows_874_table [256 ] = {
1112+ // 0 1 2 3 4 5 6 7 8 9 A B C D E F
1113+ 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , // 0x
1114+ 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , // 1x
1115+ 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , // 2x
1116+ 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 0 , 0 , 0 , 0 , 0 , 0 , // 3x
1117+ 0 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , // 4x
1118+ 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 0 , 0 , 0 , 0 , 0 , // 5x
1119+ 0 , 3 , 3 , 3 , 3 , 3 , 3 , 3 , 3 , 3 , 3 , 3 , 3 , 3 , 3 , 3 , // 6x
1120+ 3 , 3 , 3 , 3 , 3 , 3 , 3 , 3 , 3 , 3 , 3 , 0 , 0 , 0 , 0 , 0 , // 7x
1121+ 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , // 8x
1122+ 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , // 9x
1123+ 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , // Ax
1124+ 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , // Bx
1125+ 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , // Cx
1126+ 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , // Dx
1127+ 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , // Ex
1128+ 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , // Fx
1129+ };
1130+
11071131/**
11081132 * Returns the size of the next character in the ASCII encoding. This basically
11091133 * means that if the top bit is not set, the character is 1 byte long.
@@ -1214,6 +1238,7 @@ PRISM_ENCODING_TABLE(windows_1255)
12141238PRISM_ENCODING_TABLE (windows_1256 )
12151239PRISM_ENCODING_TABLE (windows_1257 )
12161240PRISM_ENCODING_TABLE (windows_1258 )
1241+ PRISM_ENCODING_TABLE (windows_874 )
12171242
12181243#undef PRISM_ENCODING_TABLE
12191244
@@ -1686,3 +1711,13 @@ pm_encoding_t pm_encoding_windows_1258 = {
16861711 .isupper_char = pm_encoding_windows_1258_isupper_char ,
16871712 .multibyte = false
16881713};
1714+
1715+ /** Windows-874 */
1716+ pm_encoding_t pm_encoding_windows_874 = {
1717+ .name = "Windows-874" ,
1718+ .char_width = pm_encoding_single_char_width ,
1719+ .alnum_char = pm_encoding_windows_874_alnum_char ,
1720+ .alpha_char = pm_encoding_windows_874_alpha_char ,
1721+ .isupper_char = pm_encoding_windows_874_isupper_char ,
1722+ .multibyte = false
1723+ };
0 commit comments