Open zoyo-de opened 5 years ago
Very important issue, since we germans use umlauts all the time.
It's important to scandinavians too (I'm affected!).
line_length counts the visible characters, not the bytes in the source string. So this looks fine on the first glimpse:
diff --git a/src/text.cpp b/src/text.cpp
index f5e3496be..b96393c33 100644
--- a/src/text.cpp
+++ b/src/text.cpp
@@ -248,7 +248,7 @@ bool extractLine (
// Premature EOL.
if (character == '\n')
{
- line = text.substr (offset, line_length);
+ line = text.substr (offset, cursor-offset-1);
offset = cursor;
return true;
}
Works for me and valgrind
seems happy about this as well.
When displaying reports, the task description gets truncated at the end by the number of multibyte characters in the description, when the task contains annotations and the description line is shorter than the annotation line.
Let me give an example session with german umlauts as multibyte characters (some unimportant lines deleted).
First we create and annotate a task without umlauts:
Everything is displayed fine. Now we add umlauts:
The description line is truncated by the number of umlauts. Now we add some fill characters so, that the description line gets longer than the annotation line:
The description line is not truncated anymore. Let's adjust the number of fill characters:
It still works. Remove one more fill character:
The end characters get truncated again.
And finally, the output of "task diag":