Date: Thu, 21 May 2009 21:19:00 +0400 From: Vyacheslav Anikin <anikinsl@gmail.com> To: FreeBSD-gnats-submit@FreeBSD.org Subject: ports/134791: [maintainer update] russian/rux: fixes to utf-8 Message-ID: <20090521171859.GA28355@cia.no> Resent-Message-ID: <200905211750.n4LHo6e9001076@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 134791 >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:50:06 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@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:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20090521171859.GA28355>