GNOME Bugzilla – Bug 664830
g_strescape doesn't natively handle \v (vertical tab)
Last modified: 2013-05-06 18:26:04 UTC
The escape sequence '\v' is well-known for the vertical tab character (see isspace(3)), but g_strescape doesn't escape it specially as it does for \b, \t, \n, etc.
A patch for this would be welcome.
Created attachment 203936 [details] [review] fix to handle '\v' by g_strescape() and g_strcompress() Fix to handle '\v' by g_strescape() and g_strcompress(). Please review the patch.
Review of attachment 203936 [details] [review]: Looks fine
The following fixes have been pushed: 8ca2647 Fix to handle '\v' (vertical tab) by g_strescape() and g_strcompress(). 030bf82 Some minor updates of building.sgml a3860d8 Some minor updates of HACKING
Created attachment 204274 [details] [review] Fix to handle '\v' (vertical tab) by g_strescape() and g_strcompress(). fix enables g_strescape() and g_strcompress() to handle '\v' along with other special characters - '\b', '\f', '\n', '\r', '\t', '\'. https://bugzilla.gnome.org/show_bug.cgi?id=664830 Signed-off-by: Ravi Sankar Guntur <ravi.g@samsung.com>
Created attachment 204275 [details] [review] Some minor updates of building.sgml
Created attachment 204276 [details] [review] Some minor updates of HACKING
This patch breaks code that uses g_strescape() to serialize strings and GScanner to deserialize them, as the latter does not interpret "\v". Note that even if GScanner is extended to cope, programs will still subtly run into issues if files are saved with a newer glib (using \v), and parsed with an older glib GScanner.
IMHO g_strescape() could convert "\v" to "\011" instead of "\\v" and not break g_strcompress() or GScanner.