To: vim-dev@vim.org Subject: Patch 6.1.294 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit ------------ Patch 6.1.294 Problem: Can't include a multi-byte character in a string by its hex value. (Benji Fisher) Solution: Add "\u....": a character specified with up to four hex numbers and stored according to the value of 'encoding'. Files: src/eval.c *** ../vim61.293/src/eval.c Sun Jan 12 13:28:21 2003 --- src/eval.c Mon Jan 13 22:37:17 2003 *************** *** 2221,2238 **** case 'r': name[i++] = CR; break; case 't': name[i++] = TAB; break; ! /* hex: "\x1", "\x12" */ ! case 'X': ! case 'x': if (isxdigit(p[1])) { ! ++p; ! name[i] = hex2nr(*p); ! if (isxdigit(p[1])) { ++p; ! name[i] = (name[i] << 4) + hex2nr(*p); } ! ++i; } else name[i++] = *p; --- 2221,2253 ---- case 'r': name[i++] = CR; break; case 't': name[i++] = TAB; break; ! case 'X': /* hex: "\x1", "\x12" */ ! case 'x': ! case 'u': /* Unicode: "\u0023" */ ! case 'U': ! if (isxdigit(p[1])) { ! int n, nr; ! int c = toupper(*p); ! ! if (c == 'X') ! n = 2; ! else ! n = 4; ! nr = 0; ! while (--n >= 0 && isxdigit(p[1])) { ++p; ! nr = (nr << 4) + hex2nr(*p); } ! #ifdef FEAT_MBYTE ! /* For "\u" store the number according to ! * 'encoding'. */ ! if (c != 'X') ! i += (*mb_char2bytes)(nr, name + i); ! else ! #endif ! name[i++] = nr; } else name[i++] = *p; *** ../vim61.293/src/version.c Sun Jan 19 16:53:13 2003 --- src/version.c Sun Jan 19 17:09:40 2003 *************** *** 608,609 **** --- 608,611 ---- { /* Add new patch number below this line */ + /**/ + 294, /**/ -- If someone questions your market projections, simply point out that your target market is "People who are nuts" and "People who will buy any damn thing". Nobody is going to tell you there aren't enough of those people to go around. (Scott Adams - The Dilbert principle) /// Bram Moolenaar -- Bram@moolenaar.net -- http://www.Moolenaar.net \\\ /// Creator of Vim - Vi IMproved -- http://www.Vim.org \\\ \\\ Project leader for A-A-P -- http://www.A-A-P.org /// \\\ Help AIDS victims, buy at Amazon -- http://ICCF.nl/click1.html ///