hachyderm.io is one of the many independent Mastodon servers you can use to participate in the fediverse.
Hachyderm is a safe space, LGBTQIA+ and BLM, primarily comprised of tech industry professionals world wide. Note that many non-user account types have restrictions - please see our About page.

Administered by:

Server stats:

10K
active users

Trying to figure out how to print a UTF32 character in C and so far the answer seems to be "you can't"

@eniko On conforming implementions, printf("%lc", unicode_codepoint_val);

@eniko wint_t, but default promotions from wchar_t should be fine.

@dalias everything i've found tells me not to use wchar_t because it is unclear what width its going to be

@eniko Because Windows is wrong. If wchar_t is too narrow for full Unicode you're not allowed to support all of Unicode. C explicitly forbids "multi wchar_t chars" (thus UTF-16) which they do because they insisted on contradicting the experts in the early 90s who told them 16 bits wasn't enough and got themselves stuck. C11 strongly prefers wchar_t numeric vals be UCS codepoints (there's a macro that tells you this) and unless I'm misremembering, C23 requires it.

Lulu · לולו

@dalias @eniko

The fact that UTF-16 can't die is just wild.

@lulu @dalias @eniko Java's internal representation for non-ASCII strings is UTF-16 and its not immediately clear how that could be changed. So I think it'll be around for the forseeable future.

@dalias @lulu @eniko Number of active server JVMs in the wild continues to increase, having doubled in ~6 years IIRC.

@kittylyst @dalias @eniko

Yes, I know. Same for javascript. But this is so bad.