From owner-freebsd-questions@FreeBSD.ORG Thu Jan 17 15:42:31 2008 Return-Path: Delivered-To: questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 50B4016A46B for ; Thu, 17 Jan 2008 15:42:31 +0000 (UTC) (envelope-from rafael.carre@gmail.com) Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.158]) by mx1.freebsd.org (Postfix) with ESMTP id 2062313C465 for ; Thu, 17 Jan 2008 15:42:28 +0000 (UTC) (envelope-from rafael.carre@gmail.com) Received: by fg-out-1718.google.com with SMTP id 16so801625fgg.35 for ; Thu, 17 Jan 2008 07:42:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:subject:message-id:x-mailer:mime-version:content-type:sender; bh=kTpDuJA1hfDhJtKv3QpJIkusvwEP5gOryPcM21TG4d0=; b=P4wYrH4aVI/LP/+uPyiJEKxj9EA2ftbxO05nbz+X5uFAE1NBbiNuZa+dXHUFj7mbVH3K4g4l3vu/3slP32CaN4JFV1eZIn6yS/rkHPNv7kHzEdnzfQoochXGNQSFoiZEGjZOUX0Zz5CENwJ156AuZ2htnQ4xK168jSDnxdrtjsc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:subject:message-id:x-mailer:mime-version:content-type:sender; b=cg8E/UQ/lhC/g0yKEMH/iAeFNIA7xRJUDZprlG1UnwocaS+1hi8apDPIuk/3Z4Io2N9i3Spmg2kqt8Srx/9rCHNhftBicP+VwYxJnreog4wraL4xvafUH1oAJkmRwKvR6UtqgB41/2yeMqDc0lbvsljIGtqfWb3SBzO3M7D0XOw= Received: by 10.86.1.1 with SMTP id 1mr2018972fga.2.1200582832538; Thu, 17 Jan 2008 07:13:52 -0800 (PST) Received: from zod.zod ( [138.195.130.70]) by mx.google.com with ESMTPS id 4sm2515211fge.3.2008.01.17.07.13.50 (version=SSLv3 cipher=OTHER); Thu, 17 Jan 2008 07:13:51 -0800 (PST) Date: Thu, 17 Jan 2008 16:13:29 +0100 From: =?UTF-8?B?UmFmYcOrbCBDYXJyw6k=?= To: questions@freebsd.org Message-ID: <20080117161329.69fe4135@zod.zod> X-Mailer: Claws Mail 3.0.2 (GTK+ 2.12.1; i386-portbld-freebsd7.0) Mime-Version: 1.0 Content-Type: multipart/signed; boundary="Sig_/E.JkcNTlRDC02h.7oneId8g"; protocol="application/pgp-signature"; micalg=PGP-SHA1 Sender: =?ISO-8859-1?B?UmFmYetsIENhcnLp?= Cc: Subject: Some UTF-8 characters are not representable on FreeBSD7 X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Jan 2008 15:42:31 -0000 --Sig_/E.JkcNTlRDC02h.7oneId8g Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hello, I noticed I couldn't use some characters with libncursesw: namely =E2=9A=91= =E2=9A=90 and =E2=8F=8F. I run into some tests and found that some characters were reported as unprintable, while on Linux all was fine. I found it extremely strange since those characters would show up in my terminal (gnome-terminal) when I pasted them. Here are the results of the test I ran on Linux and FreeBSD: [fun@zod ~]% uname -a ;./test FreeBSD zod 7.0-BETA3 FreeBSD 7.0-BETA3 #0: Sun Dec 2 02:30:18 CET 2007 root@zod:/media/externe/usr/src/sys/ZOD i386 Locale: fr_FR.UTF-8 OK a : 1=20 OK =E2=9A=91 : 0 OK =C3=B6 : 1 OK =E2=86=91 : 1 OK =C2=A9 : 1 OK =E2=9A=90 : 0 OK =C3=A9 : 1 OK =E2=8F=8F : 0 [fun@zod ~]% uname -a ; LANG=3Dfr_FR.ISO8859-15 ./test FreeBSD zod 7.0-BETA3 FreeBSD 7.0-BETA3 #0: Sun Dec 2 02:30:18 CET 2007 root@zod:/media/externe/usr/src/sys/ZOD i386 Locale: fr_FR.ISO8859-15 OK a : 1 OK =E2=9A=91 : 1 OK =C3=B6 : 1 OK =E2=86=91 : 1 OK =C2=A9 : 1 OK =E2=9A=90 : 1 OK =C3=A9 : 1 OK =E2=8F=8F : 1 16:03 funman@altair ~% uname -a ; ./test=20 Linux altair 2.6.22-2-amd64 #1 SMP Thu Aug 30 23:43:59 UTC 2007 x86_64 GNU/Linux Locale: fr_FR.UTF-8 OK a : 32768 OK =E2=9A=91 : 1 OK =C3=B6 : 1 OK =E2=86=91 : 1 OK =C2=A9 : 1 OK =E2=9A=90 : 1 OK =C3=A9 : 1 OK =E2=8F=8F : 1 A value of 0 means unprintable, a positive value means printable (there is a graphical representation). And here is the test I used: #include #include #include #include int main(void) { printf( "Locale: %s\n", setlocale( LC_ALL, getenv( "LANG" ) ) ); #define MAX 8 const char const tab[MAX][6] =3D { "a", "=E2=9A=91", "=C3=B6", "=E2=86=91", "=C2=A9", "=E2=9A=90", "= =C3=A9", "=E2=8F=8F" }; int i; wchar_t wc; for( i =3D 0; i < MAX; i++ ) { printf("%s ", mbtowc( &wc, tab[i], 6 ) ? "OK" : "KO" ); printf("%s : %d\n", tab[i], iswgraph( wc ) ); } return 0; } I suppose this is a bug in UTF-8 locale, I tested with different $LANG finished by "UTF-8" and the result was the same. Am I right that an Unicode character should always have a graphical representation in an UTF-8 locale ? Thanks --=20 Rafa=C3=ABl Carr=C3=A9 --Sig_/E.JkcNTlRDC02h.7oneId8g Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.4 (FreeBSD) iD8DBQFHj3CcYWCeGMCv8Q8RAhTGAKCvuh60BrgBl8fQHEWgg+LFmj+fAACgzBaH 614hND+LTvD6IrwtSVH3Xtc= =RJlK -----END PGP SIGNATURE----- --Sig_/E.JkcNTlRDC02h.7oneId8g--