[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Testing for UTF-8 tty mode




Markus Kuhn wrote:

> I have also never been able to imagine an application (not even
> for debugging really), where it comes in handy to have the keyboard but
> not the screen in UTF-8 mode, or vice versa. It is usually only a
> situation that comes up temporarily when one side has not yet been
> implemented.

It would be useful to display UTF8 without the need to type it.  For example
for less.  Also for editors, since there are other methods to enter special
characters (e.g., digraphs).

I don't see an application for being able to type UTF8 without displaying it.

> > Users: Bruno or somebody (forgive me, I have no memory) told what the
> > user does:
> > 	setenv LC_CTYPE utf8
> > Now user programs know that the data they handle is utf8 encoded.
> 
> Yes. Either because they check themselves whether LC_CTYPE matches
> ".*[uU][tT][fF]-?8.*", or they use internally completely wchar_t and let
> the C library worry about any external character encoding issues
> using wprintf(), wscanf(), etc.

That doesn't solve the problem of having different types of files on my
harddisk.  This depends on the specific file, not on the environment.  The
only solution for this is that the file itself specifies its encoding.  I'm
new here, perhaps you have already a method for this?

For an editor, you might want to switch dynamically between different modes,
depending on the type of file being edited at the time.  This becomes really
"interesting" when using split-windows...  The solution would probably be to
convert a file when it's read in, and convert it back when written out.
LC_CTYPE could then specify the internal format that the editor uses, but not
the format of the file itself, which could be anything.

> > Does this also hold for filenames?
> 
> Yes, of course.
> 
> > Maybe no for vfat or joliet - I understand these come with
> > character set information, but have not looked at the details.
> 
> What should happen is that mount checks LC_CTYPE and passes this
> information down to the vfat driver. I don't think, this has been
> implemented yet.

And what if I have one file system with (say, from Windows NT) and one without
(say from OS/2) that type?  This probably requires specifying the type to
mount itself.  LC_CTYPE could be used as the default though.

--
hundred-and-one symptoms of being an internet addict:
59. Your wife says communication is important in a marriage...so you buy
    another computer and install a second phone line so the two of you can
    chat.

--/-/---- Bram Moolenaar ---- Bram@moolenaar.net ---- Bram@vim.org ---\-\--
  \ \    www.vim.org/iccf      www.moolenaar.net       www.vim.org    / /
-
Linux-UTF8:   i18n of Linux on all levels
Archive:      http://mail.nl.linux.org/lists/