forked from gentoo/gentoo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
openlierox-0.58_rc1-icu.patch
67 lines (59 loc) · 2.43 KB
/
openlierox-0.58_rc1-icu.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
From f30e2447944c5131b9c9502ca8054f847d1a9c0f Mon Sep 17 00:00:00 2001
From: Albert Zeyer <[email protected]>
Date: Tue, 22 Mar 2011 14:42:15 +0100
Subject: [PATCH] rename UnicodeString to Unicode32String
Seems that ICU (unicode/unistr.h) polutes the global namespace and uses this name. See http://bugs.gentoo.org/show_bug.cgi?id=359655 .
---
include/Unicode.h | 6 +++---
src/common/Unicode.cpp | 8 ++++----
2 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/include/Unicode.h b/include/Unicode.h
index a523b46..5b976ab 100644
--- a/include/Unicode.h
+++ b/include/Unicode.h
@@ -15,7 +15,7 @@
#include <string>
typedef Uint32 UnicodeChar;
-typedef std::basic_string<UnicodeChar> UnicodeString;
+typedef std::basic_string<UnicodeChar> Unicode32String;
#ifdef WIN32
typedef wchar_t Utf16Char;
typedef std::wstring Utf16String;
@@ -158,8 +158,8 @@ char UnicodeCharToAsciiChar(UnicodeChar c);
std::string RemoveSpecialChars(const std::string &Utf8String);
std::string Utf16ToUtf8(const Utf16String& str);
Utf16String Utf8ToUtf16(const std::string& str);
-std::string UnicodeToUtf8(const UnicodeString& str);
-UnicodeString Utf8ToUnicode(const std::string& str);
+std::string UnicodeToUtf8(const Unicode32String& str);
+Unicode32String Utf8ToUnicode(const std::string& str);
std::string UnicodeToAscii(const std::string& utf8str);
std::string ISO88591ToUtf8(const std::string& isostr);
#ifdef WIN32
diff --git a/src/common/Unicode.cpp b/src/common/Unicode.cpp
index 5956289..5a58c30 100644
--- a/src/common/Unicode.cpp
+++ b/src/common/Unicode.cpp
@@ -1055,10 +1055,10 @@ Utf16String Utf8ToUtf16(const std::string& str)
//////////////////
// Convert a Unicode string to UTF8
-std::string UnicodeToUtf8(const UnicodeString& str)
+std::string UnicodeToUtf8(const Unicode32String& str)
{
std::string result;
- for (UnicodeString::const_iterator i = str.begin(); i != str.end(); i++) {
+ for (Unicode32String::const_iterator i = str.begin(); i != str.end(); i++) {
result += GetUtf8FromUnicode(*i);
}
@@ -1067,9 +1067,9 @@ std::string UnicodeToUtf8(const UnicodeString& str)
//////////////////
// Convert a UTF8 string to Unicode
-UnicodeString Utf8ToUnicode(const std::string& str)
+Unicode32String Utf8ToUnicode(const std::string& str)
{
- UnicodeString result;
+ Unicode32String result;
for (std::string::const_iterator it = str.begin(); it != str.end();)
result += GetNextUnicodeFromUtf8(it, str.end());
--
1.7.3.4