Mailing List Archive

Support open source code!


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

Re: kinput and kterm SOLVED!!!!!



Martin Baehr <mbaehr@example.com> writes:

> On Wed, Oct 24, 2001 at 03:48:07AM +0200, Tobias Diedrich wrote:
> > > i think i need to kill LANG alltogether, it seems to override LC_*;
> > It should not. AFAIK only LC_ALL overrides the other settings.
> 
> LC_ALL only overrides LC_*;
> but maybe i didn't test it properly...

Yes, LC_ALL is an override for LC_*. LANG does not override LC_*,
only LC_* variables which are not explicitely set inherit from LANG.
For example:

    mfabian@example.com:~$ locale
    LANG=ja_JP
    LC_CTYPE="ja_JP"
    LC_NUMERIC="ja_JP"
    LC_TIME="ja_JP"
    LC_COLLATE=POSIX
    LC_MONETARY="ja_JP"
    LC_MESSAGES="ja_JP"
    LC_PAPER="ja_JP"
    LC_NAME="ja_JP"
    LC_ADDRESS="ja_JP"
    LC_TELEPHONE="ja_JP"
    LC_MEASUREMENT="ja_JP"
    LC_IDENTIFICATION="ja_JP"
    LC_ALL=
    mfabian@example.com:~$

The LC_* variables which have their value between "" have not been
explicitely set, they inherit their value from LANG. Only
LC_COLLATE has been explicitely set to POSIX, therefore you don't
see any "" around POSIX. Now look at this:

    mfabian@example.com:~$ LC_CTYPE=de_DE LC_MESSAGES=ja_JP locale
    LANG=ja_JP
    LC_CTYPE=de_DE
    LC_NUMERIC="ja_JP"
    LC_TIME="ja_JP"
    LC_COLLATE=POSIX
    LC_MONETARY="ja_JP"
    LC_MESSAGES=ja_JP
    LC_PAPER="ja_JP"
    LC_NAME="ja_JP"
    LC_ADDRESS="ja_JP"
    LC_TELEPHONE="ja_JP"
    LC_MEASUREMENT="ja_JP"
    LC_IDENTIFICATION="ja_JP"
    LC_ALL=
    mfabian@example.com:~$ 

LC_CTYPE has changed to de_DE (without "") and LC_MESSAGES has lost
the "" although its value is unchanged. 

> > My guess is that vim always uses LC_CTYPE encoding whereas jvim tries to
> > be smart about the encoding used... OTOH I would not expect it to write
> > iso-2022-jp if LC_CTYPE is set to euc-jp...
> 
> could be, but it should at least read them and tell me about it,
> and not give me garbage.
> if i can't edit data coming from foreign systems, what's the point?

You can specify the encoding used to read and write a file explicitely
in Vim 6.0. For example you can load a iso-2022-jp encoded file like:

    :e ++enc=iso-2022-jp filename

also check the Vim 6.0 documentation for the 'encoding' and the
'fileencodings' options. 'encoding' is initialized from the locale
you are running Vim in. There is no ja_JP.ISO-2022-JP locale on Linux,
therefore the default value for 'encoding' will never be iso-2022-jp.
That doesn't stop you from setting it manually though. 

> > > what programs do you use for converting?
> > For converting between japanese charsets I usually use nkf (network
> > kanji filter).
> 
> apt-get install nkf;
> done. thanks.

iconv, which is already part of glibc can be used as well.

-- 
Mike Fabian   <mfabian@example.com>   http://www.suse.de/~mfabian
睡眠不足はいい仕事の敵だ。

Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links