Skip to content

Commit 33b05e1

Browse files
committed
Fix conversion bug in CP1258 converter.
1 parent 4c5433e commit 33b05e1

File tree

4 files changed

+16
-7
lines changed

4 files changed

+16
-7
lines changed

ChangeLog

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
2011-08-06 Bruno Haible <bruno@clisp.org>
2+
3+
Fix conversion bug in CP1258 converter.
4+
* lib/vietcomb.h (viet_comp_table_data): Remove entry for
5+
U+00A5 U+0301. Fix entry for U+00A8 U+0301.
6+
(viet_decomp_table): Fix entry for U+0385.
7+
* tests/CP1258.IRREVERSIBLE.TXT: Update.
8+
Reported by Gertjan Halkes <gertjan@ghalkes.nl>.
9+
110
2011-07-03 Bruno Haible <bruno@clisp.org>
211

312
Improve interactive behaviour of iconv program.

NEWS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
BIG5-HKSCS:2004. A new converter BIG5-HKSCS:2008 is added. BIG5-HKSCS is now
55
an alias for BIG5-HKSCS:2008.
66
* Fixed a bug in the conversion to wchar_t.
7+
* Fixed a small bug in the CP1258 converter.
78

89
New in 1.13:
910
* The library and the iconv program now understand platform dependent aliases,

lib/vietcomb.h

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2001, 2004 Free Software Foundation, Inc.
2+
* Copyright (C) 2001, 2004, 2011 Free Software Foundation, Inc.
33
* This file is part of the GNU LIBICONV Library.
44
*
55
* The GNU LIBICONV Library is free software; you can redistribute it
@@ -66,7 +66,7 @@ static const struct { unsigned short base; unsigned short composed; } viet_comp_
6666
{ 0x01AF, 0x1EEA },
6767
{ 0x01B0, 0x1EEB },
6868
#define viet_comp_table0301_idx (viet_comp_table0300_idx+viet_comp_table0300_len)
69-
#define viet_comp_table0301_len 64
69+
#define viet_comp_table0301_len 63
7070
{ 0x0041, 0x00C1 },
7171
{ 0x0043, 0x0106 },
7272
{ 0x0045, 0x00C9 },
@@ -101,8 +101,7 @@ static const struct { unsigned short base; unsigned short composed; } viet_comp_
101101
{ 0x0077, 0x1E83 },
102102
{ 0x0079, 0x00FD },
103103
{ 0x007A, 0x017A },
104-
{ 0x00A5, 0x0385 },
105-
{ 0x00A8, 0x1FEE },
104+
{ 0x00A8, 0x0385 }, /* prefer U+0385 over U+1FEE */
106105
{ 0x00C2, 0x1EA4 },
107106
{ 0x00C5, 0x01FA },
108107
{ 0x00C6, 0x01FC },
@@ -321,7 +320,7 @@ static const struct viet_decomp viet_decomp_table[] = {
321320
{ 0x01FE, 0x00D8, 1 },
322321
{ 0x01FF, 0x00F8, 1 },
323322
{ 0x02DC, 0x0020, 2 }, /* compatibility decomposition - for TCVN only */
324-
{ 0x0385, 0x00A5, 1 },
323+
{ 0x0385, 0x00A8, 1 },
325324
{ 0x1E04, 0x0042, 4 },
326325
{ 0x1E05, 0x0062, 4 },
327326
{ 0x1E08, 0x00C7, 1 },
@@ -461,7 +460,7 @@ static const struct viet_decomp viet_decomp_table[] = {
461460
{ 0x1EF8, 0x0059, 2 },
462461
{ 0x1EF9, 0x0079, 2 },
463462
{ 0x1FED, 0x00A8, 0 },
464-
{ 0x1FEE, 0x00A8, 1 },
463+
{ 0x1FEE, 0x00A8, 1 }, /* U+1FEE => U+0385 => U+00A8 U+0301 */
465464
};
466465

467466
#endif /* _VIETCOMB_H */

tests/CP1258.IRREVERSIBLE.TXT

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,8 @@
9696
0x79F2 0x1EF5
9797
0x7AEC 0x017A
9898
0x7AF2 0x1E93
99-
0xA5EC 0x0385
10099
0xA8CC 0x1FED
100+
0xA8EC 0x0385
101101
0xA8EC 0x1FEE
102102
0xC2CC 0x1EA6
103103
0xC2D2 0x1EA8

0 commit comments

Comments
 (0)