How to insert characters like ä or ü in a PHP file

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Harm Millaard

    How to insert characters like ä or ü in a PHP file

    In the PHP file for the formmailer there is an error message that I can't get correct. It does not recognize the &uml code.

    What I have is this message: 'Bitte ueberpruefen Sie die erforderlichen Felder'.

    What I want to see is this: 'Bitte überprüfen Sie die erforderlichen Felder'.

    Any suggestions on how to correct this in the PHP file, or elsewhere. Look here: http://ppbm5.com/Poffertjes-4.html and press the button 'Senden' at the bottom of the form to see what I mean.

    The current line is: <label class='form_err or_title'>Bitte ueberpruefen Sie die erforderlichen Felder</label>

    Using &uml instead of the 'e' does not work. Must be missing something simple.
  • Markus
    Recognized Expert Expert
    • Jun 2007
    • 6092

    #2
    The page displaying those characters needs to tell the browser to use a decent encoding. Use UTF-8 for your content-type header.

    Code:
    <html xmlns="http://www.w3.org/1999/xhtml" lang="en" dir="ltr"> 
    <head> 
    <title>Chinese character - Wikipedia, the free encyclopedia</title> 
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    </head>
    
    <body>
    <?php
    echo "汉字 / 漢字;";
    ?>
    </body>
    </html>

    Comment

    • Harm Millaard

      #3
      Thanks for the effort, but ultimately it was even simpler:

      Use the code for ü like this: "&uuml;" or for ä like "&auml;" without the quotes of course. So basically it is:

      & + the letter + uml; to give the letter with an umlaut.

      Comment

      • Markus
        Recognized Expert Expert
        • Jun 2007
        • 6092

        #4
        Sure, but there aren't html entities for every foreign character.

        Comment

        Working...