Thanks! :-)
I tried something similar, just to replace the 1/2-symbol when before it
is written to the header:
To do so I stored the database field in a temp. string.
Strange: In the debugger this string shows the Omega-Symbol before it
goes to the heading!
More strange: If I try to replace Omega with 1/2 nothing happens,
because obviously the Debugger shows either a wrong content or the
replace methos cannot handle this.
Even more strange: In all other controls, the 1/2 symbol shows correct.
Only the listbox header mangles it ..
Storing the strings in an escaped format already in the database is
unfortunately no option ...
Any other thoughts?
-- Harald
Tom Benson schrieb:
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>
_______________________________________________
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>