From: Benno Schulenberg Date: Tue, 8 Apr 2014 12:24:52 +0000 (+0000) Subject: Converting a literal UTF-8 string into its corresponding byte sequence. X-Git-Tag: v2.3.3~181 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=91c740ed3b7fecf817c4b59dfdf5aa1e444671f6;p=nano.git Converting a literal UTF-8 string into its corresponding byte sequence. Patch by David Lawrence Ramsey. git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4749 35c25a1d-7b9e-4130-9fde-d3aeb78583b8 --- diff --git a/ChangeLog b/ChangeLog index 7e335de6..eccda550 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2014-04-08 David Lawrence Ramsey + * src/nano.c (main): Convert the literal UTF-8 whitespace string into + its corresponding byte sequence, and add a comment for it. + 2014-04-08 Benno Schulenberg * src/rcfile.c (parse_binding): Melt the binding and unbinding code, which are very similar, into a single function. diff --git a/src/nano.c b/src/nano.c index de3b5c81..d2755e73 100644 --- a/src/nano.c +++ b/src/nano.c @@ -2595,11 +2595,14 @@ int main(int argc, char **argv) matchbrackets = mallocstrcpy(NULL, "(<[{)>]}"); #ifdef ENABLE_NANORC - /* If whitespace wasn't specified, set its default value. */ + /* If whitespace wasn't specified, set its default value. If we're + * using UTF-8, it's Unicode 00BB (Right-Pointing Double Angle + * Quotation Mark) and Unicode 00B7 (Middle Dot). Otherwise, it's + * ">" and ".". */ if (whitespace == NULL) { #ifdef ENABLE_UTF8 if (using_utf8()) { - whitespace = mallocstrcpy(NULL, "»·"); + whitespace = mallocstrcpy(NULL, "\xC2\xBB\xC2\xB7"); whitespace_len[0] = 2; whitespace_len[1] = 2; } else