Chinese characters in Silverlight

  • 1
  • Problem
  • Updated 10 years ago
I play the following stream with Silverlight on a Mac OS X 10.4.11:

http://player.abacast.com/pacificradi...

When the Now Playing is updated, it shows in Chinese characters.

I have tested this on my Mac mini and this does not occur.

Any idea what causes this to happen?
Photo of chessmaster

chessmaster

  • 5 Posts
  • 0 Reply Likes
  • frustrated

Posted 10 years ago

  • 1
Photo of timheuer

timheuer, Employee

  • 72 Posts
  • 8 Reply Likes
Hi chessmaster...the 'now playing' in this area of this radio stations user interface is HTML and not Silverlight...I'm not seeing what you are, but that area (now playing text) is not Silverlight. You may want to report it with a screenshot to the radio station and perhaps they aren't rendering the text correctly in HTML when they update it.
Photo of chessmaster

chessmaster

  • 5 Posts
  • 0 Reply Likes
Hello Tim,

I almost hate to admit this, but I am the developer of this application/player.

The text that is showing as chinese is the text coming from Silverlight. All text coming from the Javascript I have written does not come from Silverlight. Also, the code works in a high majority of browser/os varieties that are supported by Silverlight. This helps me to know that you are correct that this is more of a setting issue on the Mac, but I can't seem to find anything to suggest what the problem could be.

Thanks for any help or assistance - even some direction that could be provided.
Photo of timheuer

timheuer, Employee

  • 72 Posts
  • 8 Reply Likes
When you say the text 'is coming from Silverlight' are you using the HTML interop bridge to communicate with Javascript? If you debug is the text correct and it is just an issue when the browser renders it? Are characters being properly encoded?
Photo of chessmaster

chessmaster

  • 5 Posts
  • 0 Reply Likes
I am using Silverlight to pull the data off the stream ( I actually created the Silverlight script to pull the data and pass it to the same engine that the Windows Media Player object does in IE/Win ).

I just wonder if the characters are not being properly encoded ( which is definitely possible ) why would it work on all other browser/OS combinations?

Is there somewhere in Silverlight that I can force the character set to use? I created this using Blend and some of the 'special' articles you had on the web actually.
Photo of timheuer

timheuer, Employee

  • 72 Posts
  • 8 Reply Likes
hard to say without debugging with you :-) (which i'm happy to do). Silverlight uses the client's culture/regional settings for it's display. You can force specific regional settings when setting text information, etc. by passing in culture information.

When you pull the data off the stream -- in debug does it show correctly in Silverlight? Just trying to isolate what's going on. If it is being sent to HTML looking correct, then it appears to be a browser/HTML issue.
Photo of chessmaster

chessmaster

  • 5 Posts
  • 0 Reply Likes
Tim,

First I want to thank you for looking at this for me.

Next here are the HTML Content Type declarations:

and some have:

The code I am using to read the stream is in the player.js file:
ExtendedPlayer.Player.prototype = {
onMarkerReached: function(args) {

var marker = args.get_marker();
if (typeof(SilverlightEvents) != 'undefined') {
SilverlightEvents(marker.text);
}
ExtendedPlayer.Player.callBaseMethod(this, "onMarkerReached", [args]);

}
}

I have also added the following line to a test player:
window.status = "MarkerType="+type+" Text="+marker.text;

Inside the SilverlightEvents function above, we sometimes set the text from there. This text shows up properly. And the text coming from the Windows Media Player object is always correct as well. Only the text on Macs below 10.5 are showing the 'other' character types.

Here is my testing page:
http://player.abacast.com/pacificradi...

Thank you again for trying to help.
Photo of timheuer

timheuer, Employee

  • 72 Posts
  • 8 Reply Likes
Weird (I don't have an OSX 10.4 machine to look at), but it seems like it would be an OSX issue at this point to me.
Photo of chessmaster

chessmaster

  • 5 Posts
  • 0 Reply Likes
Yep, but unfortunately I need to solve this.

Thank you for trying and hope I didn't bug you too much.