>On Leopard Apple forced all strings in AppleScripts to UTF16
Yes, I discovered that too. And it brought to light two areas
(listboxes and DrawString) where RB doesn't handle UTF16 text
correctly and displays garbled text instead. The workaround is to
convert strings to UTF8 before inserting into a listbox or using
DrawString.
UTF16 strings display incorrectly in Listbox and DrawString
http://www.realsoftware.com/feedback/viewreport.php?reportid=avxgeexz
RB doesn't handle UTF16 encoded text properly and displays garbage in
two scenarios:
- DrawString of UTF16 encoded text
- When listbox text is UTF16 encoded and is too wide to fit within the cell
UTF8 encoded text works OK in both scenarios
Try code similar to this. The string returned from ConvertEncoding is
correct in both cases, but RB displays them incorrectly.
dim theEncoding as TextEncoding
if RadioButton1.Value then
theEncoding = Encodings.UTF8
else
theEncoding = Encodings.UTF16
end if
dim g as Graphics = Canvas1.Graphics
g.ClearRect 0, 0, g.width, g.Height
g.DrawString ConvertEncoding("The quick brown fox jumps over the
lazy dog.", theEncoding), 0, 20
Listbox1.DeleteAllRows
dim s as string
for i as integer = 1 to 10
s = s + "Text"
Listbox1.AddRow ConvertEncoding (s, theEncoding)
next
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>
|