Skip to content

Commit

Permalink
macos needs setlocale, not std::setlocale grumble grumble
Browse files Browse the repository at this point in the history
  • Loading branch information
unhammer committed Mar 5, 2019
1 parent 2fcb9f4 commit a1a0699
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/suggest.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -120,14 +120,14 @@ inline Casing getCasing(u16string input) {
// least it works, if the user locale is OK.
inline std::u16string toupper(const string& input) {
std::wstring w = wideFromUtf8(input);
std::setlocale(LC_ALL, "");
setlocale(LC_ALL, "");
std::transform(w.begin(), w.end(), w.begin(), std::towupper);
return fromUtf8(wideToUtf8(w));
}

inline std::u16string totitle(const string& input) {
std::wstring w = wideFromUtf8(input);
std::setlocale(LC_ALL, "");
setlocale(LC_ALL, "");
std::transform(w.begin(), w.begin()+1, w.begin(), std::towupper);
return fromUtf8(wideToUtf8(w));
}
Expand Down

0 comments on commit a1a0699

Please sign in to comment.