Skip to content

Commit

Permalink
CharsetConverter::stringCharsetToUtf8: skip conversion if not needed
Browse files Browse the repository at this point in the history
  • Loading branch information
Karlson2k committed Sep 19, 2013
1 parent aea841c commit c318f21
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions xbmc/utils/CharsetConverter.cpp
Expand Up @@ -513,6 +513,11 @@ bool CCharsetConverter::utf8ToStringCharset(std::string& stringSrcDst)

bool CCharsetConverter::stringCharsetToUtf8(const std::string& strSourceCharset, const std::string& stringSrc, std::string& utf8StringDst)
{
if (strSourceCharset == "UTF-8")
{ // simple case - no conversion necessary
utf8StringDst = stringSrc;
return true;
}
iconv_t iconvString;
ICONV_PREPARE(iconvString);
const bool result = convert(iconvString,m_Utf8CharMaxSize,strSourceCharset,"UTF-8",stringSrc,utf8StringDst);
Expand Down

0 comments on commit c318f21

Please sign in to comment.