V4RB: Encoding VString - VText

Karl Grob kgrob at mus.ch
Mon Feb 2 11:53:35 CST 2004


I have a problem with the encoding of german "Umlaute" (=8A, =9A, =9F =
...) =20
and Class VText.

My System:
RB 5.2.4
Mac OS 10.3.2
Windows98 (VirtualPC)
V4RB.rbx 23.12.03 (4'758'576 Bytes)


The following procedure produces a correct string (example is =8A) in =
the =20
MsgBox on the Mac:
=8A - 138
On Windows the MsgBox shows:
=F5 - 137
with exactly the same code, if the VField is of the class VText. The =20
Problem is there with or without DefineEncoding.
If I pass the returned string in Windows to a EditField, the Text does =20=

not show. Mac is correct.

The class VString works correctly.

If I encode the Database with DOSLatinUS (while importing Data), I do =20=

not get the right encoding for the Valentina-Program, i.e. the =8A, =9A, =
=9F =20
etc. dont show correctly. (By the way: If I set the Language of VString =20=

or VText to "German", Valentina shows always ASCII. The only way to =20
change the language seems to be the Valentina-Program itself.)

Thanks for your help.
Karl

/ =20
------------------------------------------------------------------------=20=

--------
Function getVFieldVal(cur As VCursor, Name As string) As String
    dim s, s1, ch As string
    dim i As Integer

    s =3D DefineEncoding(cur.Field(Name).GetString, encDB) // encDB =3D =20=

Encodings.MacRoman

    // Just for the Test
    for i =3D 1 to len(s)
       if Asc(mid(s, i, 1)) > 127 then
          ch =3D mid(s, i, 1)
          MsgBox ch + " - " + format(Asc(mid(s, i, 1)), "#") // Mac: =8A =
=3D =20
138 (correct); Windows: | =3D 137 (???)
       end if
    next
    // End Test

    s1 =3D ConvertEncoding(s, encPrg) // encPrg =3D =
Encodings.SystemDefault

    return s1

End Function
/ =20
------------------------------------------------------------------------=20=

--------

------
Karl Grob
Glockengasse 4
CH-8001 Z=9Frich

kgrob at mus.ch=



More information about the Valentina mailing list