mirror of
https://github.com/rad4day/Waybar.git
synced 2023-12-21 10:22:59 +01:00
Use g_unichar_iswide to properly align calendar on CJK locales
This commit is contained in:
9
src/util/ustring_clen.cpp
Normal file
9
src/util/ustring_clen.cpp
Normal 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;
|
||||
}
|
Reference in New Issue
Block a user