News for hackers. Stuff that matters.
Re:C Strings and my slow descent to madness by kevin_thibedeau on Thursday April 06, 2023 @02:41PM (#35472568)
wchar_t is a massive landmine that should never be used since its size varies by platform. Likewise char16_t and char32_t are just swimming against the easy path at this point. You're much better off sticking to UTF-8 and using the C11 u8 prefix on literals so you can use the regular string API and never have to worry about locale settings.
Re:C Strings and my slow descent to madness by Decabytes on Thursday April 06, 2023 @03:40PM (#35473346)
This is great advice! I wasn't aware of this and I will keep that in mind. When I first came across Unicode literals I was unsure when exactly you would use them over wchar_t