[V4RB] RegEx search and UTF-8

Peter De Berdt peter.de.berdt at pandora.be
Fri Jul 23 11:37:28 CDT 2004


On 23 Jul 2004, at 10:05, Ruslan Zasukhin wrote:

> On 7/23/04 11:01 AM, "Eric Ferrer" <wonderfef at noos.fr> wrote:
>
>>> Especially look for
>>> DefineEncodings in your SQLSelect, e.g. "SELECT * FROM Table WHERE
>>> MyField=3D'"+defineEncoding(mysearchstring,encodings.UTF8)+"'". It's
>>> something you easily miss.
>> Yes, I've done this.
>> By the way:
>> SELECT * FROM table WHERE Name LIKE 'bor=8Eales' NO_CASE
>> finds the records 'Bor=8Eales'
>>
>> The trouble is not there.
>> I do need my app to be very permissive considering e=8E=90=91=99=9A, =
etc.
>> This still works with Unicode :
>> SELECT * FROM table WHERE Name LIKE 'bor[e=8E=8F=90=91]' no_case
>> But this not :
>> SELECT * FROM table WHERE Name LIKE 'bor[e=8E=8F=90=91]ales' no_case
>>
>> Why ?
>
> Strange actually.
>
Once you think it over, it's not that strange actually.

Valentina will see the query as follows:

SELECT * FROM table WHERE Name LIKE 'bor[e=C3=A9=C3=A8=C3=AA=C3=AB]' =
no_case

As you can see, the =8E is represented by TWO characters and not ONE, so=20=

the query won't have a result, as the regex will only look for one of=20
the characters between the brackets. I'm glad someone brought this=20
matter up, it's one of those things to remember.

Best regards

Peter De Berdt=



More information about the Valentina mailing list