aboutsummaryrefslogtreecommitdiffstats
path: root/prism/enc
diff options
context:
space:
mode:
authorHaldun Bayhantopcu <haldun@github.com>2023-11-16 19:32:21 +0100
committergit <svn-admin@ruby-lang.org>2023-11-17 14:32:40 +0000
commit4a26a65e428fbe4088c86068d5525d1f343702ee (patch)
treed4f86e888a96f5beab29e98167612c3b2173734e /prism/enc
parent940f2e7f1893af17be6e35ef8f7ad09949a12709 (diff)
downloadruby-4a26a65e428fbe4088c86068d5525d1f343702ee.tar.gz
[ruby/prism] Add macTurkish
https://github.com/ruby/prism/commit/2232d4b6a0
Diffstat (limited to 'prism/enc')
-rw-r--r--prism/enc/pm_encoding.h1
-rw-r--r--prism/enc/pm_tables.c35
2 files changed, 36 insertions, 0 deletions
diff --git a/prism/enc/pm_encoding.h b/prism/enc/pm_encoding.h
index 7dca938241..1408423a10 100644
--- a/prism/enc/pm_encoding.h
+++ b/prism/enc/pm_encoding.h
@@ -193,6 +193,7 @@ extern pm_encoding_t pm_encoding_koi8_r;
extern pm_encoding_t pm_encoding_mac_greek;
extern pm_encoding_t pm_encoding_mac_iceland;
extern pm_encoding_t pm_encoding_mac_romania;
+extern pm_encoding_t pm_encoding_mac_turkish;
extern pm_encoding_t pm_encoding_shift_jis;
extern pm_encoding_t pm_encoding_utf_8;
extern pm_encoding_t pm_encoding_utf8_mac;
diff --git a/prism/enc/pm_tables.c b/prism/enc/pm_tables.c
index 8463c3efdb..d6d5df97f7 100644
--- a/prism/enc/pm_tables.c
+++ b/prism/enc/pm_tables.c
@@ -794,6 +794,30 @@ static uint8_t pm_encoding_mac_romania_table[256] = {
/**
* Each element of the following table contains a bitfield that indicates a
+ * piece of information about the corresponding macTurkish character.
+ */
+static uint8_t pm_encoding_mac_turkish_table[256] = {
+// 0 1 2 3 4 5 6 7 8 9 A B C D E F
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 0x
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 1x
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 2x
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 0, 0, 0, 0, 0, // 3x
+ 0, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, // 4x
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 0, 0, 0, 0, 0, // 5x
+ 0, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, // 6x
+ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 0, 0, 0, 0, 0, // 7x
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 8x
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 9x
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // Ax
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // Bx
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // Cx
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // Dx
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // Ex
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // Fx
+};
+
+/**
+ * Each element of the following table contains a bitfield that indicates a
* piece of information about the corresponding windows-1250 character.
*/
static uint8_t pm_encoding_windows_1250_table[256] = {
@@ -1105,6 +1129,7 @@ PRISM_ENCODING_TABLE(koi8_r)
PRISM_ENCODING_TABLE(mac_greek)
PRISM_ENCODING_TABLE(mac_iceland)
PRISM_ENCODING_TABLE(mac_romania)
+PRISM_ENCODING_TABLE(mac_turkish)
PRISM_ENCODING_TABLE(windows_1250)
PRISM_ENCODING_TABLE(windows_1251)
PRISM_ENCODING_TABLE(windows_1252)
@@ -1457,6 +1482,16 @@ pm_encoding_t pm_encoding_mac_romania = {
.multibyte = false
};
+/** macTurkish */
+pm_encoding_t pm_encoding_mac_turkish = {
+ .name = "macTurkish",
+ .char_width = pm_encoding_single_char_width,
+ .alnum_char = pm_encoding_mac_turkish_alnum_char,
+ .alpha_char = pm_encoding_mac_turkish_alpha_char,
+ .isupper_char = pm_encoding_mac_turkish_isupper_char,
+ .multibyte = false
+};
+
/** Windows-1250 */
pm_encoding_t pm_encoding_windows_1250 = {
.name = "Windows-1250",