Author Topic: SimString update  (Read 2188 times)

0 Members and 1 Guest are viewing this topic.

Offline Max-Max

SimString update
« on: November 04, 2013, 01:14:35 AM »
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...

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 4900
  • Total likes: 217
  • Helpful: 108
  • Languages: EN, NO
Re: SimString update
« Reply #1 on: November 04, 2013, 06:05:24 AM »
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.

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 8830
  • Total likes: 324
  • Helpful: 229
  • Languages: De,EN,JP
Re: SimString update
« Reply #2 on: November 04, 2013, 11:18:54 AM »
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).