mirror of
https://github.com/Dushistov/sdcv.git
synced 2025-12-15 09:21:55 +00:00
Unbreak tests
glib already runs the argument through g_locale_to_utf8 with G_OPTION_REMAINING
This commit is contained in:
@@ -332,10 +332,17 @@ search_result Library::process_phrase(const char *loc_str, IReadLine &io, bool f
|
||||
glib::Error err;
|
||||
search_result rval = SEARCH_SUCCESS;
|
||||
glib::CharStr str;
|
||||
if (!utf8_input_)
|
||||
str.reset(g_locale_to_utf8(loc_str, -1, &bytes_read, &bytes_written, get_addr(err)));
|
||||
else
|
||||
// Glib already runs CLI arguments through g_locale_to_utf8
|
||||
if (g_get_charset(nullptr)) {
|
||||
// Current locale is UTF-8
|
||||
str.reset(g_strdup(loc_str));
|
||||
} else {
|
||||
if (!utf8_input_) {
|
||||
str.reset(g_strdup(loc_str));
|
||||
} else {
|
||||
str.reset(g_locale_from_utf8(loc_str, -1, &bytes_read, &bytes_written, get_addr(err)));
|
||||
}
|
||||
}
|
||||
|
||||
if (nullptr == get_impl(str)) {
|
||||
fprintf(stderr, _("Can not convert %s to utf8.\n"), loc_str);
|
||||
|
||||
Reference in New Issue
Block a user