Order Now AdSolution Sign Up | Login » Bits on the Run Sign Up | Login »

Embedding with International Characters

Because web URLs can only accept ASCII characters, it is generally a good idea to name your video files using those standard characters. Sometimes however, it is necessary to load files with non-ASCII characters. In this case, you will need to URL encode the file names. In the following example, we show how to load a video file whose name is made up of Greek characters.

http://server.com/videos/λαγουδάκι.mp4

We'll need to encode the Greek characters in the URL to URL-friendly characters. We can do this by using the encodeURI JavaScript function. Here are the results:

encodeURI('http://server.com/videos/λαγουδάκι.mp4')
// Result: 
// http://server.com/videos/%CE%BB%CE%B1%CE%B3%CE%BF%CF%85%CE%B4%CE%AC%CE%BA%CE%B9.mp4

If you don't want to use encodeURI in your embed code, you can simply use the URL-friendly version (the one with the percent symbols).

Page Encoding

If you do decide to embed using international symbols, make sure your HTML page is configured to support them. There are several ways to specify character encoding in HTML, but the easiest is to add a <meta> tag in your document's <head> tag:

<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

Embed Code

Note: Because SWFObject does not handle URL encoded characters when passing them to Flash, we need to encode the variables a second time. This is the reason for the extra encodeURIComponent wrapping the variables.

Note: Because SWFObject does not handle URL encoded characters when passing them to Flash, we need to encode the variables a second time. This is the reason for the extra encodeURIComponent wrapping the variables.