From ea1e408b248b608fafed76dd7f955c7696fb21f7 Mon Sep 17 00:00:00 2001 From: Steve Checkoway Date: Tue, 19 Sep 2006 04:47:09 +0000 Subject: [PATCH] Simplify. --- stepmania/src/RageUtil_CharConversions.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/stepmania/src/RageUtil_CharConversions.cpp b/stepmania/src/RageUtil_CharConversions.cpp index 409e574018..f41957b430 100644 --- a/stepmania/src/RageUtil_CharConversions.cpp +++ b/stepmania/src/RageUtil_CharConversions.cpp @@ -11,9 +11,6 @@ /* Convert from the given codepage to UTF-8. Return true if successful. */ static bool CodePageConvert( RString &sText, int iCodePage ) { - if( sText.size() == 0 ) - return true; - int iSize = MultiByteToWideChar( iCodePage, MB_ERR_INVALID_CHARS, sText.data(), sText.size(), NULL, 0 ); if( iSize == 0 ) { @@ -41,9 +38,6 @@ static bool AttemptJapaneseConversion( RString &sText ) { return CodePageConvert static bool ConvertFromCharset( RString &sText, const char *szCharset ) { - if( sText.size() == 0 ) - return true; - iconv_t converter = iconv_open( "UTF-8", szCharset ); if( converter == (iconv_t) -1 ) { @@ -130,6 +124,9 @@ static bool AttemptJapaneseConversion( RString &sText ) { return false; } bool ConvertString( RString &str, const RString &encodings ) { + if( str.empty() ) + return true; + vector lst; split( encodings, ",", lst );