mail[Wesnoth-commits] r13813 - /trunk/src/help.cpp


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by queen . killer on October 06, 2006 - 15:49:
Author: queenkiller
Date: Fri Oct  6 15:49:03 2006
New Revision: 13813

URL: http://svn.gna.org/viewcvs/wesnoth?rev=13813&view=rev
Log:
added utf exception handling to help

Modified:
    trunk/src/help.cpp

Modified: trunk/src/help.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/help.cpp?rev=13813&r1=13812&r2=13813&view=diff
==============================================================================
--- trunk/src/help.cpp (original)
+++ trunk/src/help.cpp Fri Oct  6 15:49:03 2006
@@ -2660,10 +2660,16 @@
                const unsigned width)
 {
        std::vector<std::string> res;
+       try {
        const std::string& first_line = font::word_wrap_text(s, font_size, 
width, -1, 1);
        res.push_back(first_line);
        if(s.size() > first_line.size()) {
                res.push_back(s.substr(first_line.size()));
+       }
+       }
+       catch (utils::invalid_utf8_exception e)
+       {
+               throw parse_error (_("corrupted original file"));
        }
 
        return res;




Related Messages


Powered by MHonArc, Updated Fri Oct 06 16:00:13 2006