wesnoth-cvs-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Wesnoth-cvs-commits] wesnoth/src help.cpp


From: Jon Daniel
Subject: [Wesnoth-cvs-commits] wesnoth/src help.cpp
Date: Mon, 14 Mar 2005 15:48:36 -0500

CVSROOT:        /cvsroot/wesnoth
Module name:    wesnoth
Branch:         
Changes by:     Jon Daniel <address@hidden>     05/03/14 20:48:35

Modified files:
        src            : help.cpp 

Log message:
        fixed cap function to support utf-8 and use towupper but it still 
doesn't work
        because towupper doesn't support the complete ucs2 range. It doesn't 
work
        with e.g. Latin Extended-A 0x10D to 0x10C

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/help.cpp.diff?tr1=1.74&tr2=1.75&r1=text&r2=text

Patches:
Index: wesnoth/src/help.cpp
diff -u wesnoth/src/help.cpp:1.74 wesnoth/src/help.cpp:1.75
--- wesnoth/src/help.cpp:1.74   Thu Mar 10 22:29:57 2005
+++ wesnoth/src/help.cpp        Mon Mar 14 20:48:35 2005
@@ -2475,11 +2475,13 @@
 }
 
 std::string cap(const std::string &s) {
-       std::string res = s;
        if (s.size() > 0) {
-               res[0] = toupper(res[0]);
+               utils::utf8_iterator itor(s);
+               std::string res = utils::wchar_to_string(towupper(*itor));
+               res.append(itor.substr().second, s.end());
+               return res;
        }
-       return res;
+       return s;
 }
        
 std::string escape(const std::string &s) {




reply via email to

[Prev in Thread] Current Thread [Next in Thread]