>Submitter-Id: current-users
>Originator: Dmitry Sukhodoev
>Organization: sputnik
>Confidential: no
>Synopsis: wrong char encoding in koi8-r table
>Severity: serious
>Priority: medium
>Category: ports
>Class: update
>Release: FreeBSD 4.8-STABLE i386
>Environment:
System: FreeBSD sputnik.chel.su 4.8-STABLE FreeBSD 4.8-STABLE #0: Mon Jul 7
22:36:36 YEKST 2003 root@sputnik.chel.su:/usr/obj/usr/src/sys/sputnik i386
>Description:
the translation of symbol "number" (not sharp ("#"), exactly
number!) is incorrect in koi8-r software, which uses libiconv.
the smb filesystem also not work with files, which have this symbol in their
names.
>How-To-Repeat:
just try:
iconv -c -f koi8-r -t cp866 | iconv -f cp866 -t koi8-r
type here russian text with symbol <number>
ctrl-d
on stdout will output your text, but symbol <number> will disappear!
if you will don't use -c, then iconv cannot convert the text.
>Fix:
this path solves the problems:
=== cut on /usr/ports/converters/libiconv/files/patch-dm ==--- lib/koi8_r.h.orig
2003-07-06 21:36:00.000000000 +0600
+++ lib/koi8_r.h 2003-07-06 21:36:00.000000000 +0600
@@ -36,7 +36,7 @@
0x2557, 0x2558, 0x2559, 0x255a, 0x255b, 0x255c, 0x255d, 0x255e,
/* 0xb0 */
0x255f, 0x2560, 0x2561, 0x0401, 0x2562, 0x2563, 0x2564, 0x2565,
- 0x2566, 0x2567, 0x2568, 0x2569, 0x256a, 0x256b, 0x256c, 0x00a9,
+ 0x2566, 0x2567, 0x2568, 0x2569, 0x256a, 0x256b, 0x256c, 0x2116,
/* 0xc0 */
0x044e, 0x0430, 0x0431, 0x0446, 0x0434, 0x0435, 0x0444, 0x0433,
0x0445, 0x0438, 0x0439, 0x043a, 0x043b, 0x043c, 0x043d, 0x043e,
@@ -145,6 +145,8 @@
c = koi8_r_page23[wc-0x2320];
else if (wc >= 0x2500 && wc < 0x25a8)
c = koi8_r_page25[wc-0x2500];
+ else if (wc == 0x2116)
+ c = 0xbf;
if (c != 0) {
*r = c;
return 1;
--- lib/koi8_ru.h.orig 2001-05-26 12:00:00.000000000 +0600
+++ lib/koi8_ru.h 2003-07-06 22:01:54.000000000 +0600
@@ -34,7 +34,7 @@
0x2557, 0x2558, 0x2559, 0x255a, 0x255b, 0x0491, 0x045e, 0x255e,
/* 0xb0 */
0x255f, 0x2560, 0x2561, 0x0401, 0x0404, 0x2563, 0x0406, 0x0407,
- 0x2566, 0x2567, 0x2568, 0x2569, 0x256a, 0x0490, 0x040e, 0x00a9,
+ 0x2566, 0x2567, 0x2568, 0x2569, 0x256a, 0x0490, 0x040e, 0x2116,
/* 0xc0 */
0x044e, 0x0430, 0x0431, 0x0446, 0x0434, 0x0435, 0x0444, 0x0433,
0x0445, 0x0438, 0x0439, 0x043a, 0x043b, 0x043c, 0x043d, 0x043e,
@@ -151,6 +151,8 @@
c = koi8_ru_page23[wc-0x2320];
else if (wc >= 0x2500 && wc < 0x25a8)
c = koi8_ru_page25[wc-0x2500];
+ else if (wc == 0x2116)
+ c = 0xbf;
if (c != 0) {
*r = c;
return 1;
=== cut off /usr/ports/converters/libiconv/files/patch-dm ===