Accented characters again

Francois Van Lerberghe fvanlerberghe at freegates.be
Sat Nov 27 16:01:59 CST 2004


le 27/11/04 14:28, Leo Van den Brande <leo_van_den_brande at wxs.nl> a écrit :

> 1. If querying the DB for a specific record by its ranknr, the cursor
> finds the record and the term containing accented characters can be
> retrieved well:
> 
> c.Field(j).GetString(DefineEncoding(Temp,App.MyEncoding))  //which
> here is MacRoman

Are you sure Temp is in MacRoman encoding ?

> 
> However, if querying directly for the record containing the term with
> the accented characters:
> 
> "Select * from Cases Where name1 = '"  + Name + "'"

(Note : I should avoid using "Name" to name a variable, because it's often a
property of the current object.)

> 
> the Vcursor is empty. I tried converting or defining "Name" as
> MacRoman first, but that did not help.
> 
> What am I doing wrong?
> 
> 2. If I store text, retrieved from an editfield by direct addressing:
> 
> c.Field("name1").SetString(ConvertEncoding(DisordersWindow.Name.Text,App.MyEnc
> oding))
> 
> and, next, put the retrieved term in a listbox, it comes out correctly.
> 
> However, if I use indirect addressing:
> 
> Temp = editField(ActWi.control(i)).text     //the text is found allright
> c.Field(j).SetString(DefineEncoding(Temp,App.MyEncoding))

I think you must use ConvertEncoding here and not DefineEncoding because
Temp is a RB string that has UTF8 encoding, not MacRoman.

François Van Lerberghe
Rue Thier Monty, 15 A
4570 Marchin
Belgique



More information about the Valentina mailing list