Waybar/src/util/ustring_clen.cpp

9 lines
208 B
C++
Raw Normal View History

#include "util/ustring_clen.hpp"
2022-04-06 06:37:19 +00:00
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;
}