path: root/src/shared
diff options
authorLennart Poettering <>2018-04-11 19:52:25 +0200
committerSven Eden <>2018-08-24 16:47:08 +0200
commit5cddd659cdd6021faee07533509598d1abe403e6 (patch)
treeb8f69864e39780ac6056f2093c66206d715b5abb /src/shared
parent992056e7763dab6d1c3babd15e53ae0a100ecbec (diff)
string-util: tweak ellipsation a bit
This primarily changes to things: 1. Ellipsation to 0, 1 or 2 characters is now supported. Previously we'd hit an assert if the new lengths was < 3, this is now permitted. The result strings won't show too much info still of course, but the code becomes a bit more generic and robust to use. 2. If a UTF-8 mode is disabled and the input string is pure ASCII, then "..." is used for ellipsation, otherwise (as before) "…". This means on a pure-ASCII system we should remain pure-ASCII, matching behaviour otherwise exposed with special_glyph() and friends. Note that we'll use "…" for ellipsiation as soon as either the locale settings indicate an UTF-8 mode or the input string already contains non-ASCII unicode characters. Testing for these special cases is improved.
Diffstat (limited to 'src/shared')
0 files changed, 0 insertions, 0 deletions