-
Notifications
You must be signed in to change notification settings - Fork 97
Conversation
Some iconv() implementations don't support transliteration. When iconv with //TRANSLIT is first attempted and fails, try again without it, and remember the result. Fixes akrennmair#364
@@ -16,7 +17,7 @@ namespace newsbeuter { | |||
*/ | |||
|
|||
stfl::form::form(const std::string& text) : f(0) { | |||
ipool = stfl_ipool_create((std::string(nl_langinfo(CODESET)) + "//TRANSLIT").c_str()); | |||
ipool = stfl_ipool_create(utils::translit(std::string(nl_langinfo(CODESET)), "WCHAR_T").c_str()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can encapsulate some string conversion if we add std::string translit(const char* tocode, const std::string& fromcode)
.
(There's also final c_str()
call, but I suspect this is more tricky due to time of life details. I'll deal with this myself later.)
1 similar comment
We don't have any tests for that part of Newsbeuter, so it's a bit early to call it a day. Checklist of things I want to do before merging this:
If both of these checks fail to find any problems, I'm going to merge this PR on Sunday, October 1st. @kobezda, thanks for your work! |
Well, my testing didn't find any problems, so hopefully our users won't run into any either. Thanks, @kobezda! |
Some iconv() implementations don't support transliteration.
When iconv with //TRANSLIT is first attempted and fails,
try again without it, and remember the result.
Fixes #364
Fixes #174