summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcoen Hirschberg <marcoen@gmail.com>2007-10-01 17:16:31 +0000
committerMarcoen Hirschberg <marcoen@gmail.com>2007-10-01 17:16:31 +0000
commitded94e69c496f6cadc3c9dc856665b6b714283cf (patch)
tree550eeb401d202332c9662513032d2cc90aaed52e
parentb8753ffdaa141740e42d8c57d6f0c1aca5e6a8de (diff)
downloadrockbox-ded94e69c496f6cadc3c9dc856665b6b714283cf.tar.gz
rockbox-ded94e69c496f6cadc3c9dc856665b6b714283cf.zip
FS#7712 by Przemysław Hołubowski: New codepage (CP1250 - WIN1250) added
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14942 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/lang/english.lang15
-rw-r--r--apps/lang/polski.lang14
-rw-r--r--apps/plugins/viewer.c2
-rw-r--r--apps/settings_list.c17
-rw-r--r--docs/CREDITS1
-rw-r--r--firmware/common/unicode.c11
-rw-r--r--tools/codepage_tables.c19
-rw-r--r--tools/codepage_tables.h1
-rw-r--r--tools/codepages.c14
9 files changed, 78 insertions, 16 deletions
diff --git a/apps/lang/english.lang b/apps/lang/english.lang
index 6ad4313cf4..5b1aa68eec 100644
--- a/apps/lang/english.lang
+++ b/apps/lang/english.lang
@@ -11327,4 +11327,17 @@
11327 lcd_color: "Bar (Gradient Colour)" 11327 lcd_color: "Bar (Gradient Colour)"
11328 </voice> 11328 </voice>
11329</phrase> 11329</phrase>
11330 11330<phrase>
11331 id: LANG_CODEPAGE_CENTRAL_EUROPEAN
11332 desc: in codepage setting menu
11333 user:
11334 <source>
11335 *: "Central European (CP1250)"
11336 </source>
11337 <dest>
11338 *: "Central European (CP1250)"
11339 </dest>
11340 <voice>
11341 *: "Central Eurpean"
11342 </voice>
11343</phrase>
diff --git a/apps/lang/polski.lang b/apps/lang/polski.lang
index bf3e90ae96..59fbf40452 100644
--- a/apps/lang/polski.lang
+++ b/apps/lang/polski.lang
@@ -11038,3 +11038,17 @@
11038 radio: "Menu Radia FM" 11038 radio: "Menu Radia FM"
11039 </voice> 11039 </voice>
11040</phrase> 11040</phrase>
11041<phrase>
11042 id: LANG_CODEPAGE_CENTRAL_EUROPEAN
11043 desc: in codepage setting menu
11044 user:
11045 <source>
11046 *: "Europa Środkowa (CP1250)"
11047 </source>
11048 <dest>
11049 *: "Europa Środkowa (CP1250)"
11050 </dest>
11051 <voice>
11052 *: "Europa Środkowa"
11053 </voice>
11054</phrase>
diff --git a/apps/plugins/viewer.c b/apps/plugins/viewer.c
index 37b7b49290..2e152f106d 100644
--- a/apps/plugins/viewer.c
+++ b/apps/plugins/viewer.c
@@ -247,6 +247,7 @@ struct preferences {
247 ISO_8859_6, 247 ISO_8859_6,
248 ISO_8859_9, 248 ISO_8859_9,
249 ISO_8859_2, 249 ISO_8859_2,
250 CP1250,
250 SJIS, 251 SJIS,
251 GB2312, 252 GB2312,
252 KSX1001, 253 KSX1001,
@@ -1191,6 +1192,7 @@ static bool encoding_setting(void)
1191 {"ISO-8859-6", -1}, 1192 {"ISO-8859-6", -1},
1192 {"ISO-8859-9", -1}, 1193 {"ISO-8859-9", -1},
1193 {"ISO-8859-2", -1}, 1194 {"ISO-8859-2", -1},
1195 {"CP1250", -1},
1194 {"SJIS", -1}, 1196 {"SJIS", -1},
1195 {"GB-2312", -1}, 1197 {"GB-2312", -1},
1196 {"KSX-1001", -1}, 1198 {"KSX-1001", -1},
diff --git a/apps/settings_list.c b/apps/settings_list.c
index adc8a8572f..7981f279ff 100644
--- a/apps/settings_list.c
+++ b/apps/settings_list.c
@@ -1025,22 +1025,23 @@ const struct settings_list settings[] = {
1025#ifdef HAVE_LCD_BITMAP 1025#ifdef HAVE_LCD_BITMAP
1026 /* The order must match with that in unicode.c */ 1026 /* The order must match with that in unicode.c */
1027 "iso8859-1,iso8859-7,iso8859-8,cp1251,iso8859-11,cp1256," 1027 "iso8859-1,iso8859-7,iso8859-8,cp1251,iso8859-11,cp1256,"
1028 "iso8859-9,iso8859-2,sjis,gb2312,ksx1001,big5,utf-8", 1028 "iso8859-9,iso8859-2,cp1250,sjis,gb2312,ksx1001,big5,utf-8",
1029 set_codepage, 13, 1029 set_codepage, 14,
1030 ID2P(LANG_CODEPAGE_LATIN1), ID2P(LANG_CODEPAGE_GREEK), 1030 ID2P(LANG_CODEPAGE_LATIN1), ID2P(LANG_CODEPAGE_GREEK),
1031 ID2P(LANG_CODEPAGE_HEBREW), ID2P(LANG_CODEPAGE_CYRILLIC), 1031 ID2P(LANG_CODEPAGE_HEBREW), ID2P(LANG_CODEPAGE_CYRILLIC),
1032 ID2P(LANG_CODEPAGE_THAI), ID2P(LANG_CODEPAGE_ARABIC), 1032 ID2P(LANG_CODEPAGE_THAI), ID2P(LANG_CODEPAGE_ARABIC),
1033 ID2P(LANG_CODEPAGE_TURKISH), ID2P(LANG_CODEPAGE_LATIN_EXTENDED), 1033 ID2P(LANG_CODEPAGE_TURKISH), ID2P(LANG_CODEPAGE_LATIN_EXTENDED),
1034 ID2P(LANG_CODEPAGE_JAPANESE), ID2P(LANG_CODEPAGE_SIMPLIFIED), 1034 ID2P(LANG_CODEPAGE_CENTRAL_EUROPEAN), ID2P(LANG_CODEPAGE_JAPANESE),
1035 ID2P(LANG_CODEPAGE_KOREAN), ID2P(LANG_CODEPAGE_TRADITIONAL), 1035 ID2P(LANG_CODEPAGE_SIMPLIFIED), ID2P(LANG_CODEPAGE_KOREAN),
1036 ID2P(LANG_CODEPAGE_UTF8)), 1036 ID2P(LANG_CODEPAGE_TRADITIONAL), ID2P(LANG_CODEPAGE_UTF8)),
1037#else /* !HAVE_LCD_BITMAP */ 1037#else /* !HAVE_LCD_BITMAP */
1038 /* The order must match with that in unicode.c */ 1038 /* The order must match with that in unicode.c */
1039 "iso8859-1,iso8859-7,cp1251,iso8859-9,iso8859-2,utf-8", 1039 "iso8859-1,iso8859-7,cp1251,iso8859-9,iso8859-2,cp1250,utf-8",
1040 set_codepage, 6, 1040 set_codepage, 7,
1041 ID2P(LANG_CODEPAGE_LATIN1), ID2P(LANG_CODEPAGE_GREEK), 1041 ID2P(LANG_CODEPAGE_LATIN1), ID2P(LANG_CODEPAGE_GREEK),
1042 ID2P(LANG_CODEPAGE_CYRILLIC), ID2P(LANG_CODEPAGE_TURKISH), 1042 ID2P(LANG_CODEPAGE_CYRILLIC), ID2P(LANG_CODEPAGE_TURKISH),
1043 ID2P(LANG_CODEPAGE_LATIN_EXTENDED), ID2P(LANG_CODEPAGE_UTF8)), 1043 ID2P(LANG_CODEPAGE_LATIN_EXTENDED), ID2P(LANG_CODEPAGE_CENTRAL_EUROPEAN),
1044 ID2P(LANG_CODEPAGE_UTF8)),
1044#endif 1045#endif
1045 OFFON_SETTING(0,warnon_erase_dynplaylist, 1046 OFFON_SETTING(0,warnon_erase_dynplaylist,
1046 LANG_WARN_ERASEDYNPLAYLIST_MENU,false, 1047 LANG_WARN_ERASEDYNPLAYLIST_MENU,false,
diff --git a/docs/CREDITS b/docs/CREDITS
index 0f09162eaf..1d8d57ee4c 100644
--- a/docs/CREDITS
+++ b/docs/CREDITS
@@ -337,6 +337,7 @@ Pinitnun Shanasabang
337Ken Fazzone 337Ken Fazzone
338David Bishop 338David Bishop
339Hein-Pieter van Braam 339Hein-Pieter van Braam
340Przemysław Hołubowski
340 341
341The libmad team 342The libmad team
342The wavpack team 343The wavpack team
diff --git a/firmware/common/unicode.c b/firmware/common/unicode.c
index 2417b016d0..ba28edd15a 100644
--- a/firmware/common/unicode.c
+++ b/firmware/common/unicode.c
@@ -29,7 +29,7 @@ static int loaded_cp_table = 0;
29 29
30enum { 30enum {
31 ISO_8859_1 = 0, ISO_8859_7, ISO_8859_8, WIN_1251, 31 ISO_8859_1 = 0, ISO_8859_7, ISO_8859_8, WIN_1251,
32 ISO_8859_11, WIN_1256, ISO_8859_9, ISO_8859_2, 32 ISO_8859_11, WIN_1256, ISO_8859_9, ISO_8859_2, WIN_1250,
33 SJIS, GB_2312, KSX_1001, BIG_5, UTF_8, NUM_CODEPAGES 33 SJIS, GB_2312, KSX_1001, BIG_5, UTF_8, NUM_CODEPAGES
34}; 34};
35static const char *filename[NUM_TABLES] = 35static const char *filename[NUM_TABLES] =
@@ -42,7 +42,7 @@ static const char *filename[NUM_TABLES] =
42}; 42};
43static const char cp_2_table[NUM_CODEPAGES] = 43static const char cp_2_table[NUM_CODEPAGES] =
44{ 44{
45 0, 1, 1, 1, 1, 1, 1, 1, 2, 3, 4, 5, 0 45 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 4, 5, 0
46}; 46};
47 47
48#else /* !HAVE_LCD_BITMAP, reduced support */ 48#else /* !HAVE_LCD_BITMAP, reduced support */
@@ -51,8 +51,8 @@ static const char cp_2_table[NUM_CODEPAGES] =
51#define NUM_TABLES 1 51#define NUM_TABLES 1
52 52
53enum { 53enum {
54 ISO_8859_1 = 0, ISO_8859_7, WIN_1251, 54 ISO_8859_1 = 0, ISO_8859_7, WIN_1251, ISO_8859_9,
55 ISO_8859_9, ISO_8859_2, UTF_8, NUM_CODEPAGES 55 ISO_8859_2, WIN_1250, UTF_8, NUM_CODEPAGES
56}; 56};
57static const char *filename[NUM_TABLES] = 57static const char *filename[NUM_TABLES] =
58{ 58{
@@ -60,7 +60,7 @@ static const char *filename[NUM_TABLES] =
60}; 60};
61static const char cp_2_table[NUM_CODEPAGES] = 61static const char cp_2_table[NUM_CODEPAGES] =
62{ 62{
63 0, 1, 1, 1, 1, 0 63 0, 1, 1, 1, 1, 1, 0
64}; 64};
65 65
66#endif 66#endif
@@ -152,6 +152,7 @@ unsigned char* iso_decode(const unsigned char *iso, unsigned char *utf8,
152 case WIN_1251: /* Cyrillic */ 152 case WIN_1251: /* Cyrillic */
153 case ISO_8859_9: /* Turkish */ 153 case ISO_8859_9: /* Turkish */
154 case ISO_8859_2: /* Latin Extended */ 154 case ISO_8859_2: /* Latin Extended */
155 case WIN_1250: /* Central European */
155#ifdef HAVE_LCD_BITMAP 156#ifdef HAVE_LCD_BITMAP
156 case ISO_8859_8: /* Hebrew */ 157 case ISO_8859_8: /* Hebrew */
157 case ISO_8859_11: /* Thai */ 158 case ISO_8859_11: /* Thai */
diff --git a/tools/codepage_tables.c b/tools/codepage_tables.c
index 5f5bec9bf3..02a2304a46 100644
--- a/tools/codepage_tables.c
+++ b/tools/codepage_tables.c
@@ -25,6 +25,25 @@ const unsigned short iso8859_7_to_uni[] = {
25 0x00B0, 0x00B1, 0x00B2, 0x00B3, 0x0384, 0x0385, 0x0386, 0x00B7 /* B0-B7 */ 25 0x00B0, 0x00B1, 0x00B2, 0x00B3, 0x0384, 0x0385, 0x0386, 0x00B7 /* B0-B7 */
26}; 26};
27 27
28const unsigned short cp1250_to_uni[] = {
29 0x20AC, 0x00A0, 0x201A, 0x00A0, 0x201E, 0x2026, 0x2020, 0x2021, /* 80-87 */
30 0x00A0, 0x2030, 0x0160, 0x2039, 0x015A, 0x0164, 0x017D, 0x0179, /* 88-8F */
31 0x00A0, 0x2018, 0x2019, 0x201C, 0x201D, 0x2022, 0x2013, 0x2014, /* 90-97 */
32 0x00A0, 0x2122, 0x0161, 0x203A, 0x015B, 0x0165, 0x017E, 0x017A, /* 98-9F */
33 0x00A0, 0x02C7, 0x02D8, 0x0141, 0x00A4, 0x0104, 0x00A6, 0x00A7, /* A0-A7 */
34 0x00A8, 0x00A9, 0x015E, 0x00AB, 0x00AC, 0X00AD, 0x00AE, 0x017B, /* A8-AF */
35 0x00B0, 0x00B1, 0x02DB, 0x0142, 0x00B4, 0x00B5, 0x00B6, 0x00B7, /* B0-B7 */
36 0x00B8, 0x0105, 0x015F, 0x00BB, 0x013D, 0x02DD, 0x013E, 0x017C, /* B8-BF */
37 0x0154, 0x00C1, 0x00C2, 0x0102, 0x00C4, 0x0139, 0x0106, 0x00C7, /* C0-C7 */
38 0x010C, 0x00C9, 0x0118, 0x00CB, 0x011A, 0x00CD, 0x00CE, 0x010E, /* C8-CF */
39 0x0110, 0x0143, 0x0147, 0x00D3, 0x00D4, 0x0150, 0x00D6, 0x00D7, /* D0-D7 */
40 0x0158, 0x016E, 0x00DA, 0x0170, 0x00DC, 0x00DD, 0x0162, 0x00DF, /* D8-DF */
41 0x0155, 0x00E1, 0x00E2, 0x0103, 0x00E4, 0x013A, 0x0107, 0x00E7, /* E0-E7 */
42 0x010D, 0x00E9, 0x0119, 0x00EB, 0x011B, 0x00ED, 0x00EE, 0x010F, /* E8-EF */
43 0x0111, 0x0144, 0x0148, 0x00F3, 0x00F4, 0X0151, 0x00F6, 0x00F7, /* F0-F7 */
44 0x0159, 0x016F, 0x00FA, 0x0171, 0x00FC, 0x00FD, 0x0163, 0x02D9 /* F8-FA */
45};
46
28const unsigned short cp1251_to_uni[] = { 47const unsigned short cp1251_to_uni[] = {
29 0x0402, 0x0403, 0x201A, 0x0453, 0x201E, 0x2026, 0x2020, 0x2021, /* 80-87 */ 48 0x0402, 0x0403, 0x201A, 0x0453, 0x201E, 0x2026, 0x2020, 0x2021, /* 80-87 */
30 0x20AC, 0x2030, 0x0409, 0x2039, 0x040A, 0x040C, 0x040B, 0x040F, /* 88-8F */ 49 0x20AC, 0x2030, 0x0409, 0x2039, 0x040A, 0x040C, 0x040B, 0x040F, /* 88-8F */
diff --git a/tools/codepage_tables.h b/tools/codepage_tables.h
index 4e16ec5150..0c0bc019f3 100644
--- a/tools/codepage_tables.h
+++ b/tools/codepage_tables.h
@@ -18,6 +18,7 @@
18 ****************************************************************************/ 18 ****************************************************************************/
19 19
20extern const unsigned short iso8859_7_to_uni[]; 20extern const unsigned short iso8859_7_to_uni[];
21extern const unsigned short cp1250_to_uni[];
21extern const unsigned short cp1251_to_uni[]; 22extern const unsigned short cp1251_to_uni[];
22extern const unsigned short cp1256_to_uni[]; 23extern const unsigned short cp1256_to_uni[];
23extern const unsigned short iso8859_2_to_uni[]; 24extern const unsigned short iso8859_2_to_uni[];
diff --git a/tools/codepages.c b/tools/codepages.c
index 651a99c429..75441f2493 100644
--- a/tools/codepages.c
+++ b/tools/codepages.c
@@ -138,7 +138,17 @@ unsigned short iso_decode(unsigned char *latin1, int cp, int count)
138 ucs = iso8859_2_to_uni[*latin1++ - 0xA1]; 138 ucs = iso8859_2_to_uni[*latin1++ - 0xA1];
139 } 139 }
140 break; 140 break;
141 141
142 case 0x08: /* Central European (CP1250) */
143 while (count--) {
144 /* first convert to unicode */
145 if (*latin1 < 0x80)
146 ucs = *latin1++;
147 else
148 ucs = cp1250_to_uni[*latin1++ - 0x80];
149 }
150 break;
151
142 default: 152 default:
143 break; 153 break;
144 } 154 }
@@ -211,7 +221,7 @@ int main(int argc, char **argv)
211 of = fopen("iso.cp", "wb"); 221 of = fopen("iso.cp", "wb");
212 if (!of) return 1; 222 if (!of) return 1;
213 223
214 for (i=1; i<8; i++) { 224 for (i=1; i<9; i++) {
215 225
216 for (j=0; j<128; j++) { 226 for (j=0; j<128; j++) {
217 k = (unsigned char)j + 128; 227 k = (unsigned char)j + 128;