Accented characters again
Leo Van den Brande
leo_van_den_brande at wxs.nl
Sat Nov 27 14:28:16 CST 2004
Hi all,
I hate to ask a question which appears trivial when such important
events take place as now in Ukraïne, though it appears more and more
that the people will get the president they voted for. If it comes to
a new election, that should only stenghten the opposition's position,
for sure.
But now, my problem, probably trivial for you experts but not for me!
I'm working with Val 1.1, under Mac OS 10.2 with RB 5.2.4.
I used to store text as is and, on retrieval, define UTF8. This worked
well on a single platform, but not after moving from Mac to PC or the
other way araound.
Some time ago, I was advised, when storing text, containing accented
characters, for crossplatform use, to revamp the database for the
German language using the dump and loaddump facility of Valentina, and
store text after conversion to MacRoman under Mac OS or WindowsLatin1
under Windows and, on retrieval define MacRoman under Mac OS or
WindowsLatin1 under Windows. From a pilot project it appeared that the
definition on retrieval was not strictly necessary, but I still do it..
It seemed to work well at first. However, I encounter some problems.
These are already present on the Mac (without moving the database to a
Windows-platform):
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
However, if querying directly for the record containing the term with
the accented characters:
"Select * from Cases Where name1 = '" + Name + "'"
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.MyEncoding))
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))
and next, put the result in a listbox, it comes out as garbage.
This may seem like a RealBasic problem, but it isn't. With my old way
of storing and retrieving(store text as is and on retrieveal define
UTF8), this did not happen, though that was not the way to do it for
crossplatform work.
So again: what am I doing wrong?
I have not yet explored all circumstances of storage and retrieval,
and spent a couple of days trying to figure out things, but this is as
far as I got!
I'm stuck! So, please, let your light shine on this problem and
enlighten me. It will be greatly appreciated!
Thanks,
Leo
--
Leo Van den Brande
J.Buziaulaan 61
3584 ZT Utrecht
Tel: (+31)-30-2511767
More information about the Valentina
mailing list