Bug 250163 - iswprint wrong for NO-BREAK SPACE
Summary: iswprint wrong for NO-BREAK SPACE
Status: Closed Not A Bug
Alias: None
Product: Base System
Classification: Unclassified
Component: misc (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Many People
Assignee: freebsd-bugs (Nobody)
Depends on:
Blocks: 236397
  Show dependency treegraph
Reported: 2020-10-06 18:05 UTC by Marko Turk
Modified: 2020-10-08 00:18 UTC (History)
1 user (show)

See Also:

test code example (2.84 KB, text/plain)
2020-10-06 18:05 UTC, Marko Turk
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Marko Turk 2020-10-06 18:05:02 UTC
Created attachment 218568 [details]
test code example


iswprint returns false for L'\u00a0' (NO-BREAK SPACE), see attached code.

The same code returns true on Linux.

Is this a bug in iswprint?

Comment 1 Conrad Meyer freebsd_committer 2020-10-06 19:07:37 UTC
Check that your locale environment is actually Unicode.

With your test program, I see:

$ LANG=C ./wcw
$ LANG=C.UTF-8 ./wcw

I think this is functioning as intended.
Comment 2 Conrad Meyer freebsd_committer 2020-10-06 19:09:36 UTC
(Not a bug on CURRENT, anyway.)
Comment 3 Marko Turk 2020-10-07 06:45:33 UTC
(In reply to Conrad Meyer from comment #2)

Yes, seems to be fixed on -CURRENT. My VM with -CURRENT had wrong locale when I did the testing, sorry.

I saw the issue on 11.4-STABLE r365792:
$ env LANG=C.UTF-8 ./example3                                                               
$ env LANG=C ./example3                                                                     
Comment 4 Conrad Meyer freebsd_committer 2020-10-07 15:51:31 UTC
C.UTF-8 is new in 13, probably 11.x doesn't have it.  Try a country UTF-8 locale, e.g., en_US.UTF-8.
Comment 5 Marko Turk 2020-10-07 19:09:43 UTC
(In reply to Conrad Meyer from comment #4)
Yes, en_US.UTF-8 is my default locale, the same thing happens:

$ env LANG=en_US.UTF-8 ./example3

Comment 6 Ed Maste freebsd_committer 2020-10-08 00:18:15 UTC
It looks like this is fixed on 12.x as well.

ref12-amd64% LANG=en_CA.UTF-8 ./a.out

FreeBSD 11.4 is the last 11.x release an upgrade will be necessary to pick up the fix.