Closed veer66 closed 4 years ago
Use string char_count()
instead of length
?
Index: tootle-0.2.0/src/Dialogs/PostDialog.vala
===================================================================
--- tootle-0.2.0.orig/src/Dialogs/PostDialog.vala
+++ tootle-0.2.0/src/Dialogs/PostDialog.vala
@@ -168,9 +168,9 @@ public class Tootle.PostDialog : Gtk.Dia
}
private void validate () {
- var remain = char_limit - text.buffer.text.length;
+ var remain = char_limit - text.buffer.text.char_count();
if (spoiler.active)
- remain -= spoiler_text.buffer.text.length;
+ remain -= spoiler_text.buffer.text.char_count();
counter.label = remain.to_string ();
publish.sensitive = remain >= 0;
What should happen: In tooting window, after typing one character, i.e., ก, the counter should show 499.
What happened instead: In tooting window, after typing one character, i.e., ก, the counter should show 497.
How to reproduce: Steps to reproduce the behavior:
Screenshots:
Build context: