Ability to customize the display of notifications (& more)

Moderator: GZDoom Developers

User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49067
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Ability to customize the display of notifications (& mor

Post by Graf Zahl »

Chris wrote: TL;DR locales in C/C++ suck. Probably better to find a string or character handling library that better understands and works with Unicode/UTF-8/16/32.
Indeed. I wonder why they had to cook up something this totally and fundamentally useless. Most importantly, why is the locale global state? That alone will create all the same problems that have been plaguing OpenGL to the point that it got superseded.
dpJudas
 
 
Posts: 3040
Joined: Sat May 28, 2016 1:01 pm

Re: Ability to customize the display of notifications (& mor

Post by dpJudas »

Some of that can be explained by ancient 1980's origins of the C runtime that C++ was based on. The odd thing is that they can't even decide to make unicode part of the standard, because even today you can't actually specify a locale without it being implementation specific.

I completely agree with Chris that the solution is to simply avoid using it at all. For me, std::string is a basic container (that I always put utf-8 into, regardless of the locale) and the only other text related stuff I might use from the standard library only comes into play if its basically locale agnostic (like std::to_string(int)).
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49067
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Ability to customize the display of notifications (& mor

Post by Graf Zahl »

Considering that even the entire printf family is locale dependent, there's not much that can really be used here. I already had my fun with code breaking because the locale was set to the local country for 'proper' formatting of numbers, but totally overlooked that this renders internal text processing with floats inoperable.

These standards committees are an odd bunch. They seem so fixated at compatibility with theoretical systems that they totally lose focus of practical concerns.
This here's a good point. Apparently they want to keep things compatible with other theoretical encodings by not making an Unicode dependency. Why even use wide chars if not?
_mental_
 
 
Posts: 3812
Joined: Sun Aug 07, 2011 4:32 am

Re: Ability to customize the display of notifications (& mor

Post by _mental_ »

Here is how custom iswalpha() can be implemented. Alternatively, it's possible to code it as a huge number of if's, with or without table creation at runtime.
Post Reply

Return to “Closed Feature Suggestions [GZDoom]”