Yeah, define your own encodings....
I've run into this before, and even though I know that finding the
right encoding is the solution (UTF-16 should handle anything,
right?? - wrong), I've found that simple escape encoding and in app
substitution is the best way to go.
ie. Have a method StringFromDBfield(fieldvalue as string) as string
Have a dictionary which defines your encodings (e.g. key = "%20",
value = " ")
in the method,
1) Populate the dictionary with your encodings in our apps open event
and store it as a public object.
2) test for instances of "%" in fieldvalue, and loop for each instance
3) store the encoding in a variable = "%"+left(nthField
(fieldvalue,"%",loopIteration + 1),2)
4) if found, test dictionary.haskey(variable)
5) if true, result = replaceAll(fieldvalue,variable,dictionary
(variable).stringvalue)
6) return result
Easy as that. It adds a little overhead to retrieving strings, but
not as much as you might think, plus I'm sure some smart bugger
around here will show me how to do it even faster.... You could also
only use it on string retrieves that you KNOW to contain encodings....
- Tom
On 13/12/2006, at 11:00 PM, Harald Schneider wrote:
Hi,
I retrieve data from a MySQL database and write it to a listbox
header.
Those strings contain characters like e.g. "1/2" symbols.
When I build the header they show up as an Omega symbol on OSX and
a "=" sign on Win32. When adding a row and clicking an editable
cell, then they are suddenly replaced by the correct characters.
I tried several encodings bevore writing the header, but without
success.
Any hints ?
Thanks!
Harald
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>