mailing list of musl libc
 help / color / mirror / code / Atom feed
* [musl] Choice of wchar_t mapping for non-ASCII bytes in the POSIX locale
@ 2022-11-10  8:07 Florian Weimer
  2022-11-10 14:44 ` Rich Felker
  0 siblings, 1 reply; 4+ messages in thread
From: Florian Weimer @ 2022-11-10  8:07 UTC (permalink / raw)
  To: musl

It has come to my attention that musl uses the range 0xDF80…0xDFFF to
cover the entire byte range:

/* Arbitrary encoding for representing code units instead of characters. */
#define CODEUNIT(c) (0xdfff & (signed char)(c))
#define IS_CODEUNIT(c) ((unsigned)(c)-0xdf80 < 0x80)

There is a very similar surrogate character mapping for undecodable
UTF-8 bytes, suggested here:

  <https://web.archive.org/web/20090830064219/http://mail.nl.linux.org/linux-utf8/2000-07/msg00040.html>

It uses 0xDC80…0xDCFF.  This has been picked up by various
implementations, including Python.

Is there a reason why musl picked a different surrogate mapping here?
Isn't it similar enough to the UTF-8 hack that it makes sense to pick
the same range?

Thanks,
Florian


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-11-11 15:38 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-10  8:07 [musl] Choice of wchar_t mapping for non-ASCII bytes in the POSIX locale Florian Weimer
2022-11-10 14:44 ` Rich Felker
2022-11-11 15:02   ` Florian Weimer
2022-11-11 15:38     ` Rich Felker

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).