[Gambas-user] An utility component for Gambas

Lewis Balentine lewis at ...3412...
Mon Dec 1 23:27:40 CET 2014


 >>...and read the documentation of InStr carefully again.<<
"This function only deal with ASCII strings. To manipulate UTF-8 
strings, use the String class."

P = String.InStr("Ũ", "ŷŶũŨẽẼĩĨòåš", gb.Binary)
P = String.InStr("Ũ", "ŷŶũŨẽẼĩĨòåš", gb.IgnoreCase)
P = String.InStr("Ũ", "ŷŶũŨẽẼĩĨòåš")
P = String.InStr("Ũ", "xxxxŷŶũŨẽẼĩĨòåšXXXX", gb.Binary)
P = String.InStr("Ũ", "xxxxŷŶũŨẽẼĩĨòåšXXXX", gb.IgnoreCase)
P = String.InStr("Ũ", "xxxxŷŶũŨẽẼĩĨòåšXXXX")

same result ... P=0


On 12/01/2014 04:07 PM, Benoît Minisini wrote:
> Le 01/12/2014 23:03, Charlie Reinl a écrit :
>> Am Montag, den 01.12.2014, 15:54 -0600 schrieb Lewis Balentine:
>>>>> Removing accents from an UTF-8 string.<<
>>> H'mmmm ..... Plan "A" is a loser.
>>>
>>> it seems the instr() function does not like accented characters:
>>> P = InStr("Ũ", "ŷŶũŨẽẼĩĨòåš")
>>> Result: P=0
>>>
>> Salut Lewis,
>>
>> for UTF-8 use "String." to deal with accented characters.
>>
>>
> ...and read the documentation of InStr carefully again.
>





More information about the User mailing list