I have a foxpro table with a memo-field (containing binary data) that I want to use in Servoy.
Foxpro table codepage: 1252
URL: jdbc:dbf:/c:\foxpro_tables?charSet=Cp1252
Driver: com.hxtt.sql.dbf.DBFDriver
Version: 4.2.212 on March 10, 2011 (shipped with servoy 6)
When addressing the memo-field character conversion is done, so for instance:
In foxpro the binary value of position x of memo_field is 129
In servoy foundset.memo_field.charCodeAt() is 65533
For binary fields I don’t want this character conversion so I want to suppress this. Is this possible in any way?
(I used to use a trick to avoid character conversion, just pretended that the foxpro-tables were ISO8859_1 URL: jdbc:dbf:/c:\foxpro_tables?charSet=ISO8859_1 Driver: com.hxtt.sql.dbf.DBFDriver Version: 4.2.047 on February 21, 2009 No character conversion was done, so: In foxpro the binary value of position x of memo_field is 129 In servoy foundset.memo_field[x].charCodeAt() is 129 Voila! But after switching to the new HXTT driver (version 4.2.212) character conversion was done again : In foxpro the binary value of position x of memo_field is 129 In servoy foundset.memo_field[x].charCodeAt() is 65533)
While reading encrypted data in a DBF file using u’r parser in java. The data retreived is different from the data in
the DBF file, certain characters are read as ? marks.( the encryption is done using ASCII values ).
You can use ResultSet.getBytes(int columnIndex), not ResultSet.getString(int columnIndex) and ResultSet.getObject(int
columnIndex), to get your encrypted data, since your encrypted data is binary stream.
How can I get Servoy to use ResultSet.getBytes() in stead of ResultSet.getString() when I address foundset.memo_field
Am I right to think that the column does not contain binary data, but a string encoded as bytes?
The resultset.getString() should return the same string with the correct encoding applied.
You don’t want to suppress conversion, you need to apply the same encoding as used when the string is saved.