Use g_unichar_iswide to properly align calendar on CJK locales

This commit is contained in:
nullobsi
2021-01-31 11:53:53 -08:00
parent 69a366dced
commit d2a1f41750
4 changed files with 25 additions and 5 deletions

View File

@ -0,0 +1,9 @@
#include "util/ustring_clen.hpp"
int ustring_clen(const Glib::ustring &str){
int total = 0;
for (auto i = str.begin(); i != str.end(); ++i) {
total += g_unichar_iswide(*i) + 1;
}
return total;
}