Tuesday, December 13, 2011

AW: AW: call to iconv(...) missing somewhere in the code?

> >>> Hi,
> >>>
> >>> German message output is broken when encoding=UTF-8.
> >>> Maybe calls to convert messages to the current encoding (see :help iconv) are missing in the code?
> >>>
> >>> To reproduce here are 2 examples among many others:
> >>>
> >>>
> >>> 1. example:
> >>>
> >>> - open new gvim
> >>> - :set enc=UTF-8
> >>> - :set enc=lalala ... something invalid
> >>>
> >>> I get:
> >>> E474: Ung<fc>ltiges Argument: enc=lalala
> >>> I expect:
> >>> E474: Ungültiges Argument: enc=lalala
> >>>
> >>>
> >>> 2. example:
> >>>
> >>> - open new gvim
> >>> - :set enc=UTF-8
> >>> - :set bomb
> >>> - i<Enter><Esc> ... enter a newline to make the buffer not empty
> >>> - g<C-G> ... g CONTROL-G
> >>>
> >>> I get:
> >>> Sp 1 von 0; Zeile 2 von 2; Wort 0 von 0; Byte 4 von 4(+3 f<fc>r BOM)
> >>> I expect:
> >>> Sp 1 von 0; Zeile 2 von 2; Wort 0 von 0; Byte 4 von 4(+3 für BOM)
> >>>
> >>>
> >>> I use:
> >>>
> >>> :version
> >>> VIM - Vi IMproved 7.3 (2010 Aug 15, compiled Oct 27 2010 17:59:02)
> >>> MS-Windows 32 Bit GUI Version mit OLE-Unterstützung
> >>> Inklusive der Korrekturen: 1-46
> >>> Übersetzt von Bram@KIBAALE
> >>>
> >>>
> >>> When enc is latin1, all messages display fine.
> >>>
> >>> Thanks& regards,
> >>> Paul
> >>>
> >>>
> >>
> >> If you were running under Linux I would suggest
> >>
> >> lang mess de_DE.UTF-8
> >>
> >> but beware that the placement of this command before or after not only
> >> ":set enc=utf-8" but also ":filetype [plugin] [indent] on" and ":syntax
> >> on" (and the relative placement of these) makes a difference.
> >>
> >> Under Windows I'm less sure; maybe something like
> >>
> >> lang mess German_Germany.10646
> >>
> >> Same caveats as above about command ordering.
> >>
> >>
> >
> >
> > Hi!
> >
> > Sorry, your hint didn't change anything, but I found, that it's working
> > for Spanish:
> >
> > :set enc=utf-8
> > :lang mess es
> > Este es el cambio más nuevo
> > => WORKS FINE! "á" (Hex 00e1) is printed out fine.
> >
> > :lang mess fr
> > D<e9>j<e0> <e0> la modification la plus r<e9>cente
> > :lang mess de
> > Bereits bei der j<fc>ngsten<c4>nderung
> > => ENCODING PROBLEMS!
> >
> >
> > But when I set to :enc=latin1, then it's VICE VERSA:
> > German and French working, but Spanish not:
> >
> > :set enc=latin1
> > :lang mess es
> > Este es el cambio más nuevo
> > => Looks like UTF-8 here.
> >
> >
> > Are the messages for German and French coded in latin1,
> > and for Spanish in UTF-8?
> >
> > I agree, there needs to be some translation from the encoding of the message
> > to the encoding currently in use.
> > But how?
> > Is it something that I can configure, or is it a vim coding problem?
> >
> > I found out that in Cygwin's vim and Cygwin's gvim the German messages display
> > fine for both settings, enc=utf-8 and enc=latin1 (without that I did anything).
> >
> > Thanks& Regards,
> > Paul
> >
> >
> >
>
> Did you try the _full_ three-part locale, language_COUNTRY.encoding,
> where (IIUC) under Windows "encoding" is a numeric codepage, 10646 for
> Unicode? For German, my guess was
>
> lang mess German_Germany.10646
>
> where 10646 (from ISO/IEC 10646) is the Windows codepage for Unicode.
> Did you try it? Did you try varying the order of
>
> :language messages ...
> :set enc=...
> :filetype ...
> :syntax on
>
> ? (The latter two set up the menus, which are also influenced by the
> "messages" language.)
>
> N.B. When I was on Windows some years ago, my system locale (as set by
> the OS) was French_Belgium.1252 — hence my suggestion above.
>


Hi Tony,

yes I checked the full locale "lang mess German_Germany.10646" and I checked it
again, but sorry, no effect.
The system seems to understand "German_Germany.10646" (because when I enter nonsense
it says so), but when I afterwards query the language with "lang mess" it just
outputs "de" (see below).

I also played around with different combinations of filetypes and syntax commands,
but no effect.
First enc, then mess: see my last mail. Other orders: see below.

Full transcript of my session follows.
There I use :later to produce an error message with German umlaut characters in it.


# initial state: latin1, working

:set enc?
encoding=latin1
:lang mess
Momentane messages Sprache: "de_DE.CP1252"
:later
Bereits bei der jüngsten Änderung

# ok, let's begin.
# first "mess" then "enc":

:lang mess German_Germany.10646
:lang mess
Momentane messages Sprache: "de"
:set enc=utf-8
:later
Bereits bei der j<fc>ngsten <c4>nderung

# "syntax", then again "mess"

:syntax
Keine Syntax-Elemente f<fc>r diesen Puffer definiert
:syntax on
E749: Leerer Puffer
:syntax
Keine Syntax-Elemente f<fc>r diesen Puffer definiert
:lang mess
Momentane messages Sprache: "de"
:lang mess German_Germany.10646
:lang mess
Momentane messages Sprache: "de"
:later
Bereits bei der j<fc>ngsten <c4>nderung

# set filetype, then again "mess"

:set filetype?
filetype=
:set filetype=dos
E749: Leerer Puffer
:set filetype?
filetype=dos
:later
Bereits bei der j<fc>ngsten <c4>nderung
:set enc=latin1
:later
Bereits bei der jüngsten Änderung
:set enc=utf-8
:later
Bereits bei der j<fc>ngsten <c4>nderung
:lang mess German_Germany.10646
:later
Bereits bei der j<fc>ngsten <c4>nderung
:set enc=utf-8
:later
Bereits bei der j<fc>ngsten <c4>nderung


Thank you,
Paul


--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

No comments: