Wednesday, May 27, 2015

Re: How to uppercase the non-English characters using Windows-1250 code page?

On Wednesday, May 27, 2015 at 6:32:18 AM UTC-5, Igor Forca wrote:
> Hi,
> on gVim 7.4 on Windows 7 I have a text for example:
> abcčšž
> and I would like to get uppercase of this word, so final result should be all letters upper-cased:
> ABCČŠŽ
>
> TEST 1
> 1. Set code page: :set encoding=utf-8 fileencoding=utf-8
> 2. Type in text: abcčšž
> 3. Normal mode (go uppercase a word): gUaw
> Result is: ABCČŠŽ
> Working fine.
>
> Note: Delete text with dd command before performing new test bellow.
>
>
> TEST 2
> 1. Set code page: :set encoding=utf-8 fileencoding=cp1250
> Repeat 2 and 3 from TEST 1.
> Result is: ABCČŠŽ
> Working fine.
>
> Note: Delete text with dd command before performing new test bellow.
>
>
> TEST 3
> 1. Set code page: encoding=cp1250 fileencoding=cp1250
> Repeat 2 and 3 from TEST 1.
> Result is: ABCčšž
> English letters correctly upper-cased, but non-English letters not correctly upper-cased.
>
> Why are non-English letters not converted if using both code page settings to cp1250? Is this a bug or something else? Do I need to set some other setting?
>

I don't know...it looks like you know what you're doing though! That's a pretty thorough investigation.

It seems like either Vim is not recognizing the special characters as a word, or Vim doesn't know how to toggle the case (but for some reason only when internal encoding is an 8-bit encoding).

I tried explicitly setting 'iskeyword' to contain these characters but that had no effect on behavior. I also see no impact if I use gUaW instead of gUaw to force Vim to act on the entire non-whitespace string.

So it looks like somehow Vim does not know how to change case of the accented letters, unless using a Unicode encoding. Very strange. I don't know enough about how that is handled in the code to comment on whether it is a bug, but it's certainly not expected behavior!

--
--
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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments: