chiark / gitweb /
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)
committerSven Eden <yamakuzure@gmx.net>
Fri, 24 Aug 2018 14:47:08 +0000 (16:47 +0200)
commit0d3fd8ae03eb180e1309f8b0bfd2fbce6c3cfdcc
treea7c87610bcd4b82b6d140f791f00c784b2f5996a
parentcfbe7aeb009b9e220fde7ee61424e77fc37f18f6
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