From owner-freebsd-questions@freebsd.org Wed Jan 31 00:49:45 2018 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6E5CAECD268 for ; Wed, 31 Jan 2018 00:49:45 +0000 (UTC) (envelope-from jkerian@gmail.com) Received: from mail-it0-x233.google.com (mail-it0-x233.google.com [IPv6:2607:f8b0:4001:c0b::233]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 044476A85C for ; Wed, 31 Jan 2018 00:49:44 +0000 (UTC) (envelope-from jkerian@gmail.com) Received: by mail-it0-x233.google.com with SMTP id 196so2773837iti.5 for ; Tue, 30 Jan 2018 16:49:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=l1hD9WMEAwqDlYe2R3A+Q7M0zKyfUbzJSEUYnuZsPJs=; b=uTn3qvVc6YhvVOa4G3ILeWaCUTGIBYadK+7zabRWZkMM5IZ5/qNU4emnG+2Lhv4k7u m45lBAsi/tCb8w5438EIfOT8mvYsbVhqxsyaAeZ7BrWG4Y8OOLT3qP3J35wTtnmZaKc4 zvBmJUJ1+AkpXRZm/AoPwGXh/kMkKQaxn2Qbpvqor4qlKko37v6SmQY1LdTulEgM2ns6 I8hjcBpfGtaby7zQrTe5RWA9fUzZUVGNkhPAlquXugqY6dOscnX+l8mzqonydu+ZR3D0 9SpWSEW7hicblJyejlg7eE/53snucpCyEA3r1dOrqf6RtlAAM7qvk9+TLH4gPWgJlLGl uYeg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=l1hD9WMEAwqDlYe2R3A+Q7M0zKyfUbzJSEUYnuZsPJs=; b=kkSUmDh1Y2GFydbVBohGj1vDRy5hCHsiX81stQjOiLZ4s2uHj+Rwo5iPBUFEd0yArl ZpjE/rt4n7WqKUBoYnCNqDG33Qd0j3BTxdM3AvPPV9K5G+F5juWJALiuNH+fRn53uLuP 0dKxE6EJK8Qo6a0eM7rMdUFoJK02K846bnNA/A7//kstHU1aI/17Gx2nuIibz+3VyHdL g4QRZjANdPiCoLS69xEOpDTkvflJuqADLymNSCoN3CfsH6c7PjjVS3Nbo38oAIPddyeg BHpA21wCmMtvLdLve07SU7IXIwKB7/0z6hrg/00fYjzLi8WQvb938U5ek+Qi4ay2FABQ eafA== X-Gm-Message-State: AKwxytc9uVzIMPafumycyagc2bjt8RyT/EgX3nqoGFCx0knaCqH/w5S5 vZjQezmFM0Q3RXo1RxirL90iNm/FRLblGmre2/Ljsw== X-Google-Smtp-Source: AH8x227da7zFDrQaqUqWWX+FH4JxTpz7qC4/FG168itcmYLtJE+6s+hTDK4RUy+IXcHhcHADXieyd/zT11A2mp28qZ4= X-Received: by 10.36.31.5 with SMTP id d5mr20592648itd.136.1517359783970; Tue, 30 Jan 2018 16:49:43 -0800 (PST) MIME-Version: 1.0 Received: by 10.107.136.30 with HTTP; Tue, 30 Jan 2018 16:49:43 -0800 (PST) From: Joseph Kerian Date: Tue, 30 Jan 2018 18:49:43 -0600 Message-ID: Subject: FreeBSD iswprint() returns false for U+FF08 in UTF-8 locale To: freebsd-questions@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Jan 2018 00:49:45 -0000 I recently searched one of my drives for files containing "unprintable characters" due to some issues I was seeing with file-listing programs. When I run ls -B on one of the files, the UTF-8 pattern 0xef 0xbc 0x88 appears to be the culprit. According to http://www.utf8-chartable.de/unicode-utf8-table.pl?start=65280&utf8=0x, this should be U+FF08 a fullwidth left parenthesis. This makes some sense, given the file. According to http://demo.icu-project.org/icu-bin/ubrowse?ch=FF08, U+FF08 should be a perfectly printable character in a UTF-8 locale. Looking at the ls.c source code eventually led me to iswprint(). I wrote the simple program to test print the character enums and then print iswprint() results in a few locales on a series of characters. https://wandbox.org/permlink/ZDc36tQhh7BLRpBx Linux and OSX have some odd behavior around the classes, but U+2002 and U+FF08 are both perfectly printable on both systems. On the other hand FreeBSD is only returning 1 for iswprint(0x64) Results from my box here here: https://gist.github.com/anonymous/0f21e139ae10c8c7996e7c056d686a7b, the results on that wandbox link are pretty typical for Linux systems. (My box is running: FreeBSD 11.1-RELEASE-p4 GENERIC amd64) Is this a bug? Am I missing a pkg/port to properly support UTF-8? -- -- Joe Kerian Email: jkerian@gmail.com