This project is closed and read-only.
Actions
Backport #4028
closedsubstring selection and utf8 encoding problem
Backport #4028:
substring selection and utf8 encoding problem
Status:
Closed
Assignee:
Description
=begin
Substring selection does not work with some utf8 encoded strings. Below is an example. The first substring is well extracted but the second not (extrange characters appear at the end of the substring).
It seems it occurs when the string includes letters with umlauts, accents, etc.
$ irb
ruby-1.9.1-p378 > word = "Ábaco"
=> "Ábaco"
ruby-1.9.1-p378 > substr = word[word.length-1,word.length]
=> "o"
ruby-1.9.1-p378 > word = "Coordinador de ONG's do País Valenciano"
=> "Coordinador de ONG's do País Valenciano"
ruby-1.9.1-p378 > substr = word[word.length-1,word.length]
=> "o\x00\x00\x01\x00\x01\x00\x00\x00"
=end
Actions