check if s and locale_charset ptrs are NULL before conversion

This commit is contained in:
Andrzej Rybczak
2009-01-27 00:07:50 +01:00
parent 22c48d0314
commit 5b5d33c642

View File

@@ -166,14 +166,14 @@ std::string locale_to_utf_cpy(const std::string &s)
void str_pool_utf_to_locale(char *&s)
{
if (!has_non_ascii_chars(s))
if (!s || !locale_charset || !has_non_ascii_chars(s))
return;
charset_convert("utf8", locale_charset, s);
}
void str_pool_locale_to_utf(char *&s)
{
if (!has_non_ascii_chars(s))
if (!s || !locale_charset || !has_non_ascii_chars(s))
return;
charset_convert(locale_charset, "utf8", s);
}