|
From: Johnny O. <js...@us...> - 2010-10-28 20:46:52
|
Module: performous
Branch: opengl2
Commit: 8af8a27f6ae958232cb2f81ae4a07d7b5a99ddb5
Author: Tapio Vierros <tap...@gm...>
Date: Sun Oct 24 20:48:52 2010 +0300
Work-around for Windows glibmm problems.
---
game/unicode.cc | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/game/unicode.cc b/game/unicode.cc
index 7d404e8..b2a8852 100644
--- a/game/unicode.cc
+++ b/game/unicode.cc
@@ -4,6 +4,11 @@
#include <glibmm/convert.h>
#include <sstream>
+// FIXME: Glib::convert may throw a Glib::ConvertError that doesn't
+// get caught in Windows builds with dynamic glibmm.
+#ifdef _WIN32
+void convertToUTF8( std::stringstream &, std::string ) {
+#else
void convertToUTF8( std::stringstream &_stream, std::string _filename ) {
try {
Glib::convert(_stream.str(), "UTF-8", "UTF-8"); // Test if input is UTF-8
@@ -17,6 +22,7 @@ void convertToUTF8( std::stringstream &_stream, std::string _filename ) {
for (char ch; _stream.get(ch);) tmp += (ch >= 0x20 && ch < 0x7F) ? ch : '?';
}
}
+#endif
}
std::string unicodeCollate(std::string const& str) {
|