On Aug 3, 2006, at 4:17 pm, Mars Saxman wrote:
On Aug 3, 2006, at 1:12 PM, GregO wrote:
Can anyone tell me why converting the text of an editfield
containing diacriticals (which starts as UTF8) to MacRoman works
just fine, but converting a nil encoded string which contains a
few diacriticals (which is what I'm getting back from HTTPSocket)
to UTF8 and then to MacRoman results in an empty string? I
wouldn't expect there to be a difference.....
I can't answer that question, but why are you trying to convert
text with an unknown encoding in the first place? You should define
its encoding to whatever the web server says its encoding is,
*then* convert.
Ya, my mistake. I should have said... that I was defining the
encoding as UTF8 and then converting to MacRoman. I'm trying to use
babelfish to do some conversions... the code looks like this:
dim h as new HTTPSocket
dim d as new Dictionary
dim str as string
h.yield = true
d.Value("doit") = "done"
d.Value("lp") = "en_fr"
d.Value("urltext") = "This is a test of the emergency broadcast
system... This is only a test."
d.value("submit") = "Translate"
h.SetFormData d
str = h.Post("http://babelfish.altavista.com/babelfish/tr",30)
str = DefineEncoding(s,encodings.UTF8)
str = ConvertEncoding(s,encodings.MacRoman)
str is empty after the conversion.
GregO
_______________________________________________
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>