UTF-8 Encoding problems

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

UTF-8 Encoding problems

Michal-21
Hello,
I have problems with UTF-8 encodings in my GVIM 6.3.79 under FreeBSD. I
am looking for some good UTF-8 font, and found some:

guifont=-misc-fixed-medium-r-semicondensed-*-*-120-*-*-c-*-iso10646-1

I try load utf-8 test text from
http://pages.cpsc.ucalgary.ca/%7Emirtchov/p9/fonts/utf8demo.txt and it
looks really great!

But. When I try to type some czech national characters, like ??????? I
got this "error":
- i go into insert mode, press some national key and nothing happend
- but after pressing space (or national key several times), the correct
symbol was showed

Does anybode know why I get this strange behaviour?

Thank you for any reply
Regards
Michal
Reply | Threaded
Open this post in threaded view
|

UTF-8 Encoding problems -- UPDATE

Michal-21
Michal wrote:

> Hello,
> I have problems with UTF-8 encodings in my GVIM 6.3.79 under FreeBSD. I
> am looking for some good UTF-8 font, and found some:
>
> guifont=-misc-fixed-medium-r-semicondensed-*-*-120-*-*-c-*-iso10646-1
>
> I try load utf-8 test text from
> http://pages.cpsc.ucalgary.ca/%7Emirtchov/p9/fonts/utf8demo.txt and it
> looks really great!
>
> But. When I try to type some czech national characters, like ??????? I
> got this "error":
> - i go into insert mode, press some national key and nothing happend
> - but after pressing space (or national key several times), the correct
> symbol was showed

I found, that this is not true. It is true only for several characters
(????), but for ??? characters there is not any way how to type (and
display) it.

>
> Does anybode know why I get this strange behaviour?
>
> Thank you for any reply
> Regards
> Michal
>

Reply | Threaded
Open this post in threaded view
|

Re: UTF-8 Encoding problems

A.J.Mechelynck
In reply to this post by Michal-21
----- Original Message -----
From: "Michal" <[hidden email]>
To: <[hidden email]>
Sent: Wednesday, July 27, 2005 10:47 AM
Subject: UTF-8 Encoding problems


> Hello,
> I have problems with UTF-8 encodings in my GVIM 6.3.79 under FreeBSD. I am
> looking for some good UTF-8 font, and found some:
>
> guifont=-misc-fixed-medium-r-semicondensed-*-*-120-*-*-c-*-iso10646-1
>
> I try load utf-8 test text from
> http://pages.cpsc.ucalgary.ca/%7Emirtchov/p9/fonts/utf8demo.txt and it
> looks really great!
>
> But. When I try to type some czech national characters, like ??????? I
> got this "error":
> - i go into insert mode, press some national key and nothing happend
> - but after pressing space (or national key several times), the correct
> symbol was showed
>
> Does anybode know why I get this strange behaviour?
>
> Thank you for any reply
> Regards
> Michal
>
>

It may be that the national character is indistinguishable from something
that starts a mapping. This could be the case if, for instance, you have
mappings starting with Alt-something. (You may try looking at the output of
the ":map!" command, with exclamation mark but without quotes or arguments,
looking for your "Czech" characters: in that listing, Alt-keys are replaced
by their "printable equivalents" in the current 'encoding'.) If it's that,
pressing almost any key (other than those in the mapping) would make the
"national character" to appear. For instance in "?esky", the ? should appear
no later than when you hit the e. If you want to make it appear immediately
without adding another character, you can follow it with <Left><Right>.
(Yes, I know, it's a kludge. The "real" solution is to find the mapping and
remove it or change it.)

Also, (if it's what I think), tweaking your 'timeout', 'timeoutlen',
'ttimeout' and 'ttimeoutlen' options might help: after some timeout, the key
is no more eligible for a mapping and it gets displayed. What to set those
options to depends on "who hou are": set longer timeouts (higher values) if
you type slowly, shorter (smaller values) if you are impatient by nature.
Somewhere you will strike an equilibrium.

HTH,
Tony.


Reply | Threaded
Open this post in threaded view
|

Re: UTF-8 Encoding problems -- UPDATE

A.J.Mechelynck
In reply to this post by Michal-21
----- Original Message -----
From: "Michal" <[hidden email]>
To: <[hidden email]>
Sent: Wednesday, July 27, 2005 11:06 AM
Subject: UTF-8 Encoding problems -- UPDATE


> Michal wrote:
>> Hello,
>> I have problems with UTF-8 encodings in my GVIM 6.3.79 under FreeBSD. I
>> am looking for some good UTF-8 font, and found some:
>>
>> guifont=-misc-fixed-medium-r-semicondensed-*-*-120-*-*-c-*-iso10646-1
>>
>> I try load utf-8 test text from
>> http://pages.cpsc.ucalgary.ca/%7Emirtchov/p9/fonts/utf8demo.txt and it
>> looks really great!
>>
>> But. When I try to type some czech national characters, like ??????? I
>> got this "error":
>> - i go into insert mode, press some national key and nothing happend
>> - but after pressing space (or national key several times), the correct
>> symbol was showed
>
> I found, that this is not true. It is true only for several characters
> (????), but for ??? characters there is not any way how to type (and
> display) it.
>
>>
>> Does anybode know why I get this strange behaviour?
>>
>> Thank you for any reply
>> Regards
>> Michal

In addition to my earlier post, it may be that Vim confuses those keys with
Alt-keys handled by the menu system. Try

    :set winaltkeys=no

(which disables keyboard access to menus) and look if it makes a difference.
Setting 'winaltkeys' to "menu" is usually a good compromise but I suppose
that in some languages it may clash in the way you mention.

HTH,
Tony.


Reply | Threaded
Open this post in threaded view
|

Re: UTF-8 Encoding problems -- UPDATE

Michal-21
Thank you Tony for reply.
I continued in tests and found some easy solution of my problem:

When I run gvim (or vim) form uxterm (previous test was done by invoking
gvim from xterm), there is no problem!
Everything run correctly.
I dont know why, but it runs... :)

Thank you for your posts.
Regards
Michal

Tony Mechelynck wrote:

> ----- Original Message ----- From: "Michal" <[hidden email]>
> To: <[hidden email]>
> Sent: Wednesday, July 27, 2005 11:06 AM
> Subject: UTF-8 Encoding problems -- UPDATE
>
>
>> Michal wrote:
>>
>>> Hello,
>>> I have problems with UTF-8 encodings in my GVIM 6.3.79 under FreeBSD.
>>> I am looking for some good UTF-8 font, and found some:
>>>
>>> guifont=-misc-fixed-medium-r-semicondensed-*-*-120-*-*-c-*-iso10646-1
>>>
>>> I try load utf-8 test text from
>>> http://pages.cpsc.ucalgary.ca/%7Emirtchov/p9/fonts/utf8demo.txt and
>>> it looks really great!
>>>
>>> But. When I try to type some czech national characters, like
>>> ??????? I got this "error":
>>> - i go into insert mode, press some national key and nothing happend
>>> - but after pressing space (or national key several times), the
>>> correct symbol was showed
>>
>>
>> I found, that this is not true. It is true only for several characters
>> (????), but for ??? characters there is not any way how to type (and
>> display) it.
>>
>>>
>>> Does anybode know why I get this strange behaviour?
>>>
>>> Thank you for any reply
>>> Regards
>>> Michal
>
>
> In addition to my earlier post, it may be that Vim confuses those keys
> with Alt-keys handled by the menu system. Try
>
>    :set winaltkeys=no
>
> (which disables keyboard access to menus) and look if it makes a
> difference. Setting 'winaltkeys' to "menu" is usually a good compromise
> but I suppose that in some languages it may clash in the way you mention.
>
> HTH,
> Tony.
>
>

Reply | Threaded
Open this post in threaded view
|

Re: UTF-8 Encoding problems

A.J.Mechelynck
In reply to this post by A.J.Mechelynck
----- Original Message -----
From: "Tony Mechelynck" <[hidden email]>
To: "Michal" <[hidden email]>; <[hidden email]>
Sent: Wednesday, July 27, 2005 11:04 AM
Subject: Re: UTF-8 Encoding problems


> ----- Original Message -----
> From: "Michal" <[hidden email]>
> To: <[hidden email]>
> Sent: Wednesday, July 27, 2005 10:47 AM
> Subject: UTF-8 Encoding problems

Oh, and I forgot. When switching to UTF-8 you shouldn't leave 'termencoding'
empty, because if you do Vim will think that your keyboard is in UTF-8 while
the OS happily goes on sending the keys in your national encoding. I use
something like

    if &tenc == ""
        let &tenc = &enc
    endif
    set enc=utf-8
    set guifont=<something, platform-dependent>
etc.

If you know what encoding your OS is using you can set it manually, as in

    :set tenc=cp1250 enc=utf-8

(replace cp1250 by whatever your keyboard uses)


HTH,
Tony.