Fix conversion bug in CP1258 converter.
diff --git a/ChangeLog b/ChangeLog
index af162dd..0f07076 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2011-08-06  Bruno Haible  <bruno@clisp.org>
+
+	Fix conversion bug in CP1258 converter.
+	* lib/vietcomb.h (viet_comp_table_data): Remove entry for
+	U+00A5 U+0301. Fix entry for U+00A8 U+0301.
+	(viet_decomp_table): Fix entry for U+0385.
+	* tests/CP1258.IRREVERSIBLE.TXT: Update.
+	Reported by Gertjan Halkes <gertjan@ghalkes.nl>.
+
 2011-07-03  Bruno Haible  <bruno@clisp.org>
 
 	Improve interactive behaviour of iconv program.
diff --git a/NEWS b/NEWS
index 30df72a..c0f5573 100644
--- a/NEWS
+++ b/NEWS
@@ -4,6 +4,7 @@
   BIG5-HKSCS:2004. A new converter BIG5-HKSCS:2008 is added. BIG5-HKSCS is now
   an alias for BIG5-HKSCS:2008.
 * Fixed a bug in the conversion to wchar_t.
+* Fixed a small bug in the CP1258 converter.
 
 New in 1.13:
 * The library and the iconv program now understand platform dependent aliases,
diff --git a/lib/vietcomb.h b/lib/vietcomb.h
index 34892cd..023b5e3 100644
--- a/lib/vietcomb.h
+++ b/lib/vietcomb.h
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2001, 2004 Free Software Foundation, Inc.
+ * Copyright (C) 2001, 2004, 2011 Free Software Foundation, Inc.
  * This file is part of the GNU LIBICONV Library.
  *
  * The GNU LIBICONV Library is free software; you can redistribute it
@@ -66,7 +66,7 @@
   { 0x01AF, 0x1EEA },
   { 0x01B0, 0x1EEB },
 #define viet_comp_table0301_idx (viet_comp_table0300_idx+viet_comp_table0300_len)
-#define viet_comp_table0301_len 64
+#define viet_comp_table0301_len 63
   { 0x0041, 0x00C1 },
   { 0x0043, 0x0106 },
   { 0x0045, 0x00C9 },
@@ -101,8 +101,7 @@
   { 0x0077, 0x1E83 },
   { 0x0079, 0x00FD },
   { 0x007A, 0x017A },
-  { 0x00A5, 0x0385 },
-  { 0x00A8, 0x1FEE },
+  { 0x00A8, 0x0385 }, /* prefer U+0385 over U+1FEE */
   { 0x00C2, 0x1EA4 },
   { 0x00C5, 0x01FA },
   { 0x00C6, 0x01FC },
@@ -321,7 +320,7 @@
   { 0x01FE, 0x00D8, 1 },
   { 0x01FF, 0x00F8, 1 },
   { 0x02DC, 0x0020, 2 }, /* compatibility decomposition - for TCVN only */
-  { 0x0385, 0x00A5, 1 },
+  { 0x0385, 0x00A8, 1 },
   { 0x1E04, 0x0042, 4 },
   { 0x1E05, 0x0062, 4 },
   { 0x1E08, 0x00C7, 1 },
@@ -461,7 +460,7 @@
   { 0x1EF8, 0x0059, 2 },
   { 0x1EF9, 0x0079, 2 },
   { 0x1FED, 0x00A8, 0 },
-  { 0x1FEE, 0x00A8, 1 },
+  { 0x1FEE, 0x00A8, 1 }, /* U+1FEE => U+0385 => U+00A8 U+0301 */
 };
 
 #endif /* _VIETCOMB_H */
diff --git a/tests/CP1258.IRREVERSIBLE.TXT b/tests/CP1258.IRREVERSIBLE.TXT
index 68a5481..cec1382 100644
--- a/tests/CP1258.IRREVERSIBLE.TXT
+++ b/tests/CP1258.IRREVERSIBLE.TXT
@@ -96,8 +96,8 @@
 0x79F2	0x1EF5
 0x7AEC	0x017A
 0x7AF2	0x1E93
-0xA5EC	0x0385
 0xA8CC	0x1FED
+0xA8EC	0x0385
 0xA8EC	0x1FEE
 0xC2CC	0x1EA6
 0xC2D2	0x1EA8