[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Wesnoth-cvs-commits] wesnoth/src/serialization string_utils.cpp
From: |
David White |
Subject: |
[Wesnoth-cvs-commits] wesnoth/src/serialization string_utils.cpp |
Date: |
Sun, 13 Mar 2005 22:52:49 -0500 |
CVSROOT: /cvsroot/wesnoth
Module name: wesnoth
Branch:
Changes by: David White <address@hidden> 05/03/14 03:52:49
Modified files:
src/serialization: string_utils.cpp
Log message:
fixed a bug in character set conversion function which would produce
incorrect results
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/serialization/string_utils.cpp.diff?tr1=1.10&tr2=1.11&r1=text&r2=text
Patches:
Index: wesnoth/src/serialization/string_utils.cpp
diff -u wesnoth/src/serialization/string_utils.cpp:1.10
wesnoth/src/serialization/string_utils.cpp:1.11
--- wesnoth/src/serialization/string_utils.cpp:1.10 Sat Mar 12 04:42:59 2005
+++ wesnoth/src/serialization/string_utils.cpp Mon Mar 14 03:52:48 2005
@@ -1,4 +1,4 @@
-/* $Id: string_utils.cpp,v 1.10 2005/03/12 04:42:59 j_daniel Exp $ */
+/* $Id: string_utils.cpp,v 1.11 2005/03/14 03:52:48 Sirp Exp $ */
/*
Copyright (C) 2003 by David White <address@hidden>
Copyright (C) 2005 by Guillaume Melquiond <address@hidden>
@@ -515,18 +515,18 @@
ucs2_string::const_iterator itor = src.begin();
for(;itor != src.end(); ++itor) {
if(*itor < 0x0080) {
- dst.push_back(*itor);
+ push_back(dst,*itor);
continue;
}
- if(0x0080 <= *itor < 0x0800) {
- dst.push_back((*itor >> 6) | 0xC0);
- dst.push_back((*itor & 0x003F) | 0x80);
+ if(0x0080 <= *itor && *itor < 0x0800) {
+ push_back(dst,(*itor >> 6) | 0xC0);
+ push_back(dst,(*itor & 0x003F) | 0x80);
continue;
}
- if((0x0800 <= *itor < 0xD800) || (0xDFFF < *itor < 0xFFFE)) {
- dst.push_back((*itor >> 12) | 0xE0);
- dst.push_back(((*itor >> 6) & 0x003F) | 0x80);
- dst.push_back((*itor & 0x003F) | 0x80);
+ if((0x0800 <= *itor && *itor < 0xD800) || (0xDFFF < *itor &&
*itor < 0xFFFE)) {
+ push_back(dst,(*itor >> 12) | 0xE0);
+ push_back(dst,((*itor >> 6) & 0x003F) | 0x80);
+ push_back(dst,(*itor & 0x003F) | 0x80);
}
}
return dst;