Simutrans Chat Room
Where cool people of Simutrans can meet up.

SimString update

Started by Max-Max, November 04, 2013, 01:14:35 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.


I moved my new std::string helper functions to simstring.

std::string trim(std::string)
std::string to_upper(std::string)
std::string to_lower(std::string)

These are used by the theme system (in a coming patch)...
- My code doesn't have bugs. It develops random features...


Just a warning: to_upper and to_lower are more complicated functions than one would believe. I've read that one has to think internationalization when using them.


Better never ever use to_upper and to_lower on filesnames on on Unicode, if you ever hope that you code work on something else than DOS or windows. to?lower does very ugly stuff with umlaute too, i.e. may or may not ignore them. For the same reason I would not use trim, as there are spaces that are valid in file names (like the Kanji space for instance).