basic/string-util: add a convenience function to cescape mostly-ascii fields
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 17 May 2018 08:55:21 +0000 (10:55 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 31 May 2018 12:27:07 +0000 (14:27 +0200)
commit8409f688589c41ac30a1d67f41b3ffab6ae175d3
tree555d3fa10c05246fe20f79d89dbe42b42f557f71
parentb778252b4ab9b2a1ea6d01cab3057308e9af1f60
basic/string-util: add a convenience function to cescape mostly-ascii fields

It's not supposed to be the most efficient, but instead fast and simple to use.

I kept the logic in ellipsize_mem() to use unicode ellipsis even in non-unicode
locales. I'm not quite convinced things should be this way, especially that with
this patch it'd actually be simpler to always use "…" in unicode locale and "..."
otherwise, but Lennart wanted it this way for some reason.
src/basic/string-util.c
src/basic/string-util.h
src/test/test-string-util.c