character set for xml script

Discussion in 'PHP' started by mehdiali, Mar 1, 2009.

  1. #1
    Hi every one
    i am working with cisco ipPhone that can get some xml code and execute them. it is like a cell phone. however this is my code :
    
    <? 
     header("Content-type: text/xml"); 
     header("charset: UTF-8"); 
     header("Connection: close"); 
     header("Expires: -1"); 
    
     print("<CiscoIPPhoneDirectory>\n"); //cisco ipp tag
     print("\t<Title>Lunch Time Essentials</Title>\n"); 
     print("\t<Prompt>Who will deliver food today?</Prompt>\n"); 
     // .... other codes
    print("</CiscoIPPhoneDirectory>\n"); 
    ?>
    
    PHP:
    but i need to display menu and content in
    farsi language(not english) and
    when i change content of <title> and <prompt>
    into farsi, the phone shows the whole of xml code(tags)
    and replace farsi content with ??? .
    what do you suggest ?
    NOTE : because you don't have cisco ipPhone your system can't compile
    content of ciscoIPPhoneDirectory tags.
    thank you in advance
     
    mehdiali, Mar 1, 2009 IP
  2. SmallPotatoes

    SmallPotatoes Peon

    Messages:
    1,321
    Likes Received:
    41
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Are you sure the phone is capable of displaying Farsi?

    If it can, then UTF-8 should be correct. Are you using UTF-8 encoding for your Farsi? Make sure your text editor is set to save your file as UTF-8 with no BOM. If it doesn't let you do this, then you need a new text editor. BBEdit for the Mac will do it, I am sure there is something out in Windows land that can as well.

    Also, your headers are incorrect. Content-Type and charset go on the same line.

    Content-Type: text/xml; charset=UTF-8
    Code (markup):
     
    SmallPotatoes, Mar 2, 2009 IP