convert filenames to current locale if needed / some implementation improvements

This commit is contained in:
Andrzej Rybczak
2009-01-15 20:34:35 +01:00
parent 8226b9b4a2
commit 24c308dac8
9 changed files with 66 additions and 79 deletions

View File

@@ -127,6 +127,13 @@ void utf_to_locale(std::string &s)
str_pool_put(tmp);
}
std::string utf_to_locale_cpy(const std::string &s)
{
std::string result = s;
utf_to_locale(result);
return result;
}
void locale_to_utf(std::string &s)
{
if (s.empty() || !locale_charset || !has_non_ascii_chars(s))
@@ -137,6 +144,13 @@ void locale_to_utf(std::string &s)
str_pool_put(tmp);
}
std::string locale_to_utf_cpy(const std::string &s)
{
std::string result = s;
locale_to_utf(result);
return result;
}
void str_pool_utf_to_locale(char *&s)
{
if (!has_non_ascii_chars(s))