[Gambas-user] Split doesn't work properly with non-ascii chars (bug?)

Benoit Minisini gambas at ...1...
Thu Sep 9 18:24:20 CEST 2004


On Thursday 09 September 2004 14:06, Alberto Torres wrote:
> When I pass a non-ascii char to split() separator argument, it seems
> that it converts to utf-8 encoding, and split() then uses only the first
> byte:
>
> result = Split("Hola¿hola¡hola", "¿")     ' I want result be "Hola" and
> "hola¡hola"
>
> because utf "¿" is "¿" and utf "¡" is "¡", the result is the same as
> Split("Hola¿hola¡hola", "Â"):
>
> Hola
> ¿hola
> ¡hola
>
> Could split() use more than a byte so I could also do something like
> this? Split("One and two and three", " and ")
>
> Regards
> DiThi
>

No. This would be a special static method in the String class.

All string subroutines of Gambas use pure ASCII. All static method of the 
String class use UTF-8.

-- 
Benoit Minisini
mailto:gambas at ...1...




More information about the User mailing list