Monday, February 11, 2008

Setting the character encoding

Setting the character encoding is very important to import style sheets or Java scripts in an XML file. Normally this is not forgotten in a HTML or a JSP file.
Character encoding is set to unicode in the following line.
<meta equiv="Content-Type" content="text/html; CHARSET=UTF-8">

Once you have the above line in your xml/html file, you can link to style sheets successfully.
<link title="theme" rel="stylesheet" href="styles/tabstyle.css" type="text/css"/>

The XML file looks like this:

<?xml version="1.0" encoding="utf-8" ?>
<html>
<head>
<title> Test </title>
<meta HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8"/>
<link title="theme" rel="stylesheet" href="styles/tabstyle.css" type="text/css"/>

You can learn more about unicode in the following link.
http://www.w3.org/International/O-charset

No comments: