diff options
author | Adam Borowski <kilobyte@angband.pl> | 2011-10-01 00:19:34 +0200 |
---|---|---|
committer | Adam Borowski <kilobyte@angband.pl> | 2011-10-01 00:49:22 +0200 |
commit | 3d71ce5f9d6a7f4ab95e165c16154e8a3755427d (patch) | |
tree | 12a8da92441fc15323fbe546aa1a09bfc0ed5ba4 /crawl-ref/source/libutil.h | |
parent | 6df978ce34a5173b069189e25ccc98aa256e9fc1 (diff) | |
download | crawl-ref-3d71ce5f9d6a7f4ab95e165c16154e8a3755427d.tar.gz crawl-ref-3d71ce5f9d6a7f4ab95e165c16154e8a3755427d.zip |
Mostly correct uppercasing/lowercasing of Unicode strings. ij and ß are still wrong.
Ok, I can understand Germans having ß as a lowercase-only letter which can
be at most approximated with SS/Ss when uppercased, but Dutch ij rather than
ij is plain stupid. And it requires a thorough reworking, needing special
libc functions just for one alleged "letter".
Diffstat (limited to 'crawl-ref/source/libutil.h')
-rw-r--r-- | crawl-ref/source/libutil.h | 17 |
1 files changed, 2 insertions, 15 deletions
diff --git a/crawl-ref/source/libutil.h b/crawl-ref/source/libutil.h index 7cf423a28a..9da961ac3a 100644 --- a/crawl-ref/source/libutil.h +++ b/crawl-ref/source/libutil.h @@ -30,7 +30,8 @@ std::string &escape_path_spaces(std::string &s); std::string lowercase_string(std::string s); std::string &lowercase(std::string &s); std::string &uppercase(std::string &s); -std::string upcase_first(std::string); +std::string uppercase_first(std::string); +std::string lowercase_first(std::string); bool key_is_escape(int key); @@ -158,20 +159,6 @@ std::vector<std::string> split_string( bool accept_empties = false, int nsplits = -1); -inline std::string lowercase_first(std::string s) -{ - if (s.length()) - s[0] = tolower(s[0]); - return (s); -} - -inline std::string uppercase_first(std::string s) -{ - if (s.length()) - s[0] = toupper(s[0]); - return (s); -} - template <typename Z> std::string comma_separated_line(Z start, Z end, const std::string &andc = " and ", |