Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: PATCH: multibyte FAQ (MacOS X)

"Jun T." wrote:
> In MacOS X, configure does not enable multibyte by default, because __STDC_IS
> O_10646__ is not defined. So "./configure; make" gives a zsh without multibyt
> e support, although it supports "\u....".

Thanks, this is useful.

> (1) "\u...." (and so insert-composed-char and insert-unicode-char) doesn't wo
> rk. This can be fixed by a patch proposed in 22085.

That's now committed.

> (2) In MacOS X, the standard file system is HFS+ which stores filenames in Un
> icode but in fully decomposed form. This means the filename returned by the c
> ompletion is also in decomposed form; the filename is displayed correctly, bu
> t it can't be edited correctly. And if I go up/down in the history stack the 
> prompt is destroyed.

I don't know anything about this, so if anyone else is able to do
something about it, splendid.

With some suggestions about xterm from Phil Pennock together with
looking through the manual, and an attempt on the Sourceforge compile
farm, I now have the following.  FreeBSD was offline; NetBSD worked with
--enable-multibyte; OpenBSD doesn't have wcswidth() so doesn't compile
with --enable-multibyte, though presumably a few configure tests ought to
help matters.

I've still had no luck with Solaris, even Solaris 9.  It didn't help
that the only UTF-8 locale around was ru_RU.UTF-8, but that isn't the
basic problem and I don't know what is; it seems that even obvious
multibyte strings like accented Latin characters aren't being
recognised, even though all the functions are present, the terminal
works fine with other multibyte systems, and LANG is set correctly.

RCS file: /cvsroot/zsh/zsh/INSTALL,v
retrieving revision 1.22
diff -u -r1.22 INSTALL
--- INSTALL	15 Dec 2005 10:38:55 -0000	1.22
+++ INSTALL	18 Dec 2005 19:32:01 -0000
@@ -276,12 +276,14 @@
 multibyte mode is believed to work automatically on:
   - All(?) current GNU/Linux distributions
-  - All(?) current BSD variants
-  - OS X 10.4.3
 and to work when configured with --enable-multibyte on:
-  - Solaris 8 and later
+  - OS X 10.4.3 (problems have been reported with multibyte characters
+    in HFS file names)
+  - NetBSD 2.0.2
+Any help with Solaris 8 or 9 would be appreciated.
 The main shell is not yet aware of multibyte characters, so for example the
 length of a scalar parameter will return the number of bytes, not
Index: Etc/FAQ.yo
RCS file: /cvsroot/zsh/zsh/Etc/FAQ.yo,v
retrieving revision 1.29
diff -u -r1.29 FAQ.yo
--- Etc/FAQ.yo	15 Dec 2005 10:38:56 -0000	1.29
+++ Etc/FAQ.yo	18 Dec 2005 19:32:05 -0000
@@ -2071,7 +2071,25 @@
    it() The terminal emulator.  Those that are supplied with a recent
       desktop environment, such as gnome-terminal, are likely to have
       extensive support for localization and may work correctly as soon
-      as they know the locale.
+      as they know the locale.  You can enable UTF-8 support for
+      tt(xterm) in its application defaults file.  The following are
+      the relevant resources; you donʼt actually need all of them, as
+      described below.  If you use a mytt(~/.Xdefaults) or
+      mytt(~/.Xresources) file for setting resources, prefix all the lines
+      with mytt(xterm):
+      verb(
+        *wideChars: true
+        *locale: true
+        *utf8: 1
+        *vt100Graphics: true
+      )
+      This turns on support for wide characters (this is enabled by the
+      tt(utf8) resource, too); enables conversions to UTF-8 from other
+      locales (this is the key resource and actually overrides
+      mytt(utf8)); turns on UTF-8 mode (this resource is mostly used to
+      force use of UTF-8 characters if your locale system isnʼt up to it);
+      and allows certain graphic characters to work even with UTF-8
+      enabled.  (Thanks to Phil Pennock for suggestions.)
    it() The font.  If you selected this from a menu in your terminal
       emulator, there's a good chance it already selected the right
       character set to go with it.  If you hand-picked an old fashioned

Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx>
Web page still at http://www.pwstephenson.fsnet.co.uk/

Messages sorted by: Reverse Date, Date, Thread, Author