SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Zealot ajaxdinesh's Avatar
    Join Date
    Apr 2009
    Location
    India
    Posts
    137
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Special Chracter Issue in HTML Page not in Flash?

    Hi,

    I have maintain a music website. My problem is,

    The client gave the music details data in xml files. In the xml file some data have a special character text. I have displayed the text from xml file in the website.

    1. I have displayed the xml text in the music player flash.
    2. another is i have displayed the same text in the html page.

    In flash the special character text automatically converted but in the html page not converted the special character. Actually i have used the web font is Arial.

    Example is given below,

    I have converted the array format in javascript from the xml file.

    Ex:
    Code JavaScript:
    <script>
    tracks['227347']	=	new Array();
    tracks['227347']['details']	=	"Toda A Minha Vida - Original Extended Mix - Toda A Minha Vida - Syke’N’Sugarstarr feat. Bonny Ferrer - Egoiste";
    </script>

    Special Character text is : 'Syke’N’Sugarstarr feat'
    Converted text is : 'SykeAC2122N Sugarstarr feat'

    Flash is converted this special character - 'Syke’N’Sugarstarr feat'

    but HTML page not converted this special character.

    did you catch my point?

    any idea to solve this issue?
    Cheers,
    Dinesh

  2. #2
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,159
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The character encoding you declare for your page does not match the encoding you used for the text.
    Birnam wood is come to Dunsinane

  3. #3
    SitePoint Zealot ajaxdinesh's Avatar
    Join Date
    Apr 2009
    Location
    India
    Posts
    137
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I have defined this character set(utf-8)

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

    1. which unicode we can define?
    2. utf-8 is commonly used to all?
    Cheers,
    Dinesh

  4. #4
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,159
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by ajaxdinesh View Post
    I have defined this character set(utf-8)

    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    That doesn't help if your web server is saying something else. A <meta> equivalent is only used if the server doesn't declare an encoding in the real Content-Type HTTP header.

    And if your encoding really is declared as UTF-8, then your content isn't encoded as UTF-8 since it isn't interpreted correctly. You'll either need to save the file as UTF-8 or change the declared encoding to whatever your file is saved as.

    Quote Originally Posted by ajaxdinesh View Post
    1. which unicode we can define?
    The variant of Unicode used in HTML and XHTML is ISO/IEC 10646. We can't 'define' it; it's an established standard that we have to follow.

    Quote Originally Posted by ajaxdinesh View Post
    2. utf-8 is commonly used to all?
    UTF-8 is a common encoding, yes. ISO 8859-1 and Windows-1252 are two other very common encodings, especially for Western sites.

    UTF-8 has the advantage of being capable of literally representing the whole range of Unicode characters. Where as ISO 8859-1 and Windows-1252 are much more limited and can only represent ~200 characters literally.
    Birnam wood is come to Dunsinane


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •