Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@dpelle
Copy link
Member

@dpelle dpelle commented Jan 24, 2017

Function tolower() did not handle correctly characters that have different
number bytes in utf8 sequence after they get transformed into lowercase.
For example, characters Ⱥ (U+023A) or Ⱦ (U+023E) have 2 bytes
utf8 sequences in upper cases, and 3 bytes in lower case.

Before this fix
:echo tolower("Ⱥ")
Ⱥ (wrong!)

After this fix:
:echo tolower("Ⱥ")
ⱥ (correct)

Tests are also added for tolower() and toupper().

@dpelle
Copy link
Member Author

dpelle commented Jan 24, 2017

This call assert_equal("IÌÍÎÏĨĪĬĮǏỈ", tolower("iìíîïĩīĭįǐỉ"))
failed in CI on some targets and succeeded on others.

I'm not sure why yet.

I'll investigate, but so far I could not reproduce the issue on my machine :-(

@brammool
Copy link
Contributor

brammool commented Jan 24, 2017 via email

Regression which cause test failire was introduced by my
previous checkin.
@dpelle
Copy link
Member Author

dpelle commented Jan 24, 2017

@brammool wrote:

Perhaps the 'casemap' option helps?

No. My patch simply had a bug, introduced in the last minute
when trying to replace a malloc/free with a realloc.
I've fixed it, reverting back to use malloc/free.
I hope that Travis & Appyeyor will now be green.

@brammool brammool closed this in cc5b22b Jan 26, 2017
chrisbra pushed a commit to chrisbra/vim that referenced this pull request Mar 25, 2017
Problem:    When making a character lower case with tolower() changes the byte
            cound, it is not made lower case.
Solution:   Add strlow_save(). (Dominique Pelle, closes vim#1406)
bfredl added a commit to bfredl/neovim that referenced this pull request Apr 9, 2017
Problem:    When making a character lower case with tolower() changes the byte
            cound, it is not made lower case.
Solution:   Add strlow_save(). (Dominique Pelle, closes vim/vim#1406)

vim/vim@cc5b22b

Join almost identical strup_save and strlow_save functions to one
Function.
bfredl added a commit to bfredl/neovim that referenced this pull request Apr 9, 2017
Problem:    When making a character lower case with tolower() changes the byte
            cound, it is not made lower case.
Solution:   Add strlow_save(). (Dominique Pelle, closes vim/vim#1406)

vim/vim@cc5b22b

Join almost identical strup_save and strlow_save functions to one
Function.
bfredl added a commit to bfredl/neovim that referenced this pull request Apr 9, 2017
Problem:    When making a character lower case with tolower() changes the byte
            cound, it is not made lower case.
Solution:   Add strlow_save(). (Dominique Pelle, closes vim/vim#1406)

vim/vim@cc5b22b

Join almost identical strup_save and strlow_save functions to one
Function.
bfredl added a commit to bfredl/neovim that referenced this pull request Apr 9, 2017
Problem:    When making a character lower case with tolower() changes the byte
            cound, it is not made lower case.
Solution:   Add strlow_save(). (Dominique Pelle, closes vim/vim#1406)

vim/vim@cc5b22b

Join almost identical strup_save and strlow_save functions to one
Function.
bfredl added a commit to bfredl/neovim that referenced this pull request Apr 10, 2017
Problem:    When making a character lower case with tolower() changes the byte
            cound, it is not made lower case.
Solution:   Add strlow_save(). (Dominique Pelle, closes vim/vim#1406)

vim/vim@cc5b22b

Join almost identical strup_save and strlow_save functions to one
Function.
desvp pushed a commit to desvp/vim that referenced this pull request May 30, 2017
Problem:    When making a character lower case with tolower() changes the byte
            cound, it is not made lower case.
Solution:   Add strlow_save(). (Dominique Pelle, closes vim#1406)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants