Short version: revBrowser does not display Unicode characters in Mac OS X (PPC/Tiger and Intel/Snow Leopard). LC 4.6.2 and 4.6.3.
Long version:
I finished writing and testing my Russian dictionary application in Windows and started testing it in Mac OS X. My first surprise is that revBrowser does not display Cyrillic (Unicode) characters--neither on a PPC (Tiger) nor on an Intel (Snow Leopard) machine. The English portion is rendered fine, including styles and everything, but Cyrillic is rendered as if every double-byte character is interpreted as a sequence of two single bytes.
The source (the HTML text that is assigned to revBrowser as its htmltext property) comes from a local html file or from a database record. The result is the same. When the same text is assigned to the unicodeText property of a field, everything looks fine.
The usual character set meta tag in the html is present and indicates UTF-8. Works fine in Windows. Is there something about displaying UTF-8 in revBrowser in Mac OS X that I need to know? The browser that is used by LC is probably part of the Mac setup, right? All browsers on those two Macs display the same Web page fine.
I'll be grateful for any solution. I hope it's something I'm doing wrong--or not doing.
Thanks,
Slava
revBrowser on Mac: bad display of Unicode chars
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- VIP Livecode Opensource Backer
- Posts: 4003
- Joined: Sun Jan 07, 2007 9:12 pm
- Location: Bochum, Germany
Re: revBrowser on Mac: bad display of Unicode chars
Hi Slava,
I tried with a download of a russian wikipedia page downloaded as html source code localy and displayed it in the revBrowser example with LC 4.6.3 on MacOSX 10.6.8. All the russian characters showed up. Could you post a zipped sample of your html-file that does work on Windows and not on a Mac?
Kind regards
Bernd
I tried with a download of a russian wikipedia page downloaded as html source code localy and displayed it in the revBrowser example with LC 4.6.3 on MacOSX 10.6.8. All the russian characters showed up. Could you post a zipped sample of your html-file that does work on Windows and not on a Mac?
Kind regards
Bernd
Re: revBrowser on Mac: bad display of Unicode chars
Hi Bernd!
Many thanks for thinking and testing.
I attach a zip archive (made in Windows) that has a very small and simple stack and an HTML file. Nothing else is required. When run in Windows 7, all buttons work, everything is beautiful. When run on my Mac G5 10.5.8 or MacBook 10.6.8, these problems are immediately visible:
1) Cyrillic letters are not displayed correctly (Russian text is unreadable).
2) RevBrowserCallScript() returns error "WebUndefined cStringUsingEncoding: unrecognized selector sent to instance."
I very much hope these problems are caused by something I am doing wrong.
sp27 (Slava)
Many thanks for thinking and testing.
I attach a zip archive (made in Windows) that has a very small and simple stack and an HTML file. Nothing else is required. When run in Windows 7, all buttons work, everything is beautiful. When run on my Mac G5 10.5.8 or MacBook 10.6.8, these problems are immediately visible:
1) Cyrillic letters are not displayed correctly (Russian text is unreadable).
2) RevBrowserCallScript() returns error "WebUndefined cStringUsingEncoding: unrecognized selector sent to instance."
I very much hope these problems are caused by something I am doing wrong.
sp27 (Slava)
- Attachments
-
- RussianInRevBrowser.zip
- (7.39 KiB) Downloaded 327 times
-
- VIP Livecode Opensource Backer
- Posts: 4003
- Joined: Sun Jan 07, 2007 9:12 pm
- Location: Bochum, Germany
Re: revBrowser on Mac: bad display of Unicode chars
Hi Slava,
I dont get your script to work, something is wrong when converting from the unicodeText of the field to UTF8. As you know I am not much into unicode, more into cheating...
If you access the file directly to display in revBrowser then it shows up correctly:
This may or may not be a solution for you.
As for the javascript error, again I don't know a thing about javascript but what I find funny is that although I get the error you describe when changing font size, the font size actually changes.
If you put the line of code into a try-end try it works, again no explanation, just an ugly hack
Sorry to be of no more of a help, maybe someone with more knowledge of unicode and javascript is able to shed some light on these issues.
All this tested on a MacBookPro 2010 (Intel), MacOSX 10.6.8, LIvecode 4.6.3
Kind regards
Bernd
I dont get your script to work, something is wrong when converting from the unicodeText of the field to UTF8. As you know I am not much into unicode, more into cheating...
If you access the file directly to display in revBrowser then it shows up correctly:
Code: Select all
revBrowserSet gBrowserID, "URL", locHTMLFilePathName
As for the javascript error, again I don't know a thing about javascript but what I find funny is that although I get the error you describe when changing font size, the font size actually changes.
If you put the line of code into a try-end try it works, again no explanation, just an ugly hack
Code: Select all
try
get revBrowserCallScript(gBrowserID, "SetFontSize", gFontSize & "px")
end try
All this tested on a MacBookPro 2010 (Intel), MacOSX 10.6.8, LIvecode 4.6.3
Kind regards
Bernd
Re: revBrowser on Mac: bad display of Unicode chars
Thanks for working on this, Bernd. I'm now going to post the issue on the dev list. Perhaps someone there has an idea.
Be well,
S.
Be well,
S.