mirror of
https://github.com/Dushistov/sdcv.git
synced 2025-12-16 09:51:56 +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;
|
glib::Error err;
|
||||||
search_result rval = SEARCH_SUCCESS;
|
search_result rval = SEARCH_SUCCESS;
|
||||||
glib::CharStr str;
|
glib::CharStr str;
|
||||||
if (!utf8_input_)
|
// Glib already runs CLI arguments through g_locale_to_utf8
|
||||||
str.reset(g_locale_to_utf8(loc_str, -1, &bytes_read, &bytes_written, get_addr(err)));
|
if (g_get_charset(nullptr)) {
|
||||||
else
|
// Current locale is UTF-8
|
||||||
str.reset(g_strdup(loc_str));
|
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)) {
|
if (nullptr == get_impl(str)) {
|
||||||
fprintf(stderr, _("Can not convert %s to utf8.\n"), loc_str);
|
fprintf(stderr, _("Can not convert %s to utf8.\n"), loc_str);
|
||||||
|
|||||||
Reference in New Issue
Block a user