ports/134790: [maintainer update] russian/rux: fixes to utf-8
Vyacheslav Anikin
anikinsl at gmail.com
Thu May 21 17:40:03 UTC 2009
>Number: 134790
>Category: ports
>Synopsis: [maintainer update] russian/rux: fixes to utf-8
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-ports-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: maintainer-update
>Submitter-Id: current-users
>Arrival-Date: Thu May 21 17:40:02 UTC 2009
>Closed-Date:
>Last-Modified:
>Originator: Vyacheslav Anikin
>Release: FreeBSD 7.1-RELEASE-p5 i386
>Organization:
>Environment:
System: FreeBSD cia.no 7.1-RELEASE-p5 FreeBSD 7.1-RELEASE-p5 #0: Sun Apr 26 01:23:07 MSD 2009 root at example.com:/usr/obj/usr/src/sys/ix i386
>Description:
Due to second bytes is equals in utf-8 sequences 0xd091 and 0xd191, this port
application outputs cyrillic 'yo' instead cyrillic 'B'.
>How-To-Repeat:
>Fix:
--- rux.c.orig 2009-05-21 20:46:40.000000000 +0400
+++ rux.c 2009-05-21 20:50:26.000000000 +0400
@@ -436,9 +436,13 @@
#ifndef DEBUG
if (strcmp(i_cp->cp_name, "utf-8") == 0) {
+ char hook[2];
+ hook[0] = o_cp->cp_data[6];
+ hook[1] = o_cp->cp_data[34];
+
while ((c = getc(in)) != EOF) {
if (c == (u_char)0xd0 || c == (u_char)0xd1) {
- ;
+ conv_tab[0x91] = c == 0xd1 ? hook[0] : hook[1];
} else {
putc(conv_tab[(u_char) c], out);
}
@@ -484,8 +488,13 @@
recode_buf(u_char *conv_tab, u_char *buf, int len, FILE *out)
{
if (strcmp(i_cp->cp_name, "utf-8") == 0) {
+ char hook[2];
+ hook[0] = o_cp->cp_data[6];
+ hook[1] = o_cp->cp_data[34];
+
while (len--) {
if (*buf == (u_char)0xd0 || *buf == (u_char)0xd1) {
+ conv_tab[0x91] = *buf == 0xd1 ? hook[0] : hook[1];
++buf;
} else {
putc(conv_tab[*buf++], out);
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-ports-bugs
mailing list