×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Registered User
    Join Date
    Mar 2006
    Posts
    3

    XHTML Mobile and accented characters

    Hi, to the following address: http://www.demetrionaccari.it/wap/ I am preparing a draft of mobile wap 2.0 site unfortunately I have a problem of visualization with the accented characters: "à è é ù ò ì" etcetera.

    I have tried to specify the encoding of the characters this way:

    <? xml version = "1.0" encoding = "iso-8859-1"?>

    but unfortunately nothing to be done, does someone of you know how to tell me as a problem of the kind he resolves?

  2. #2
    Super Contributor
    Join Date
    Mar 2003
    Location
    Finland
    Posts
    9,560

    Re: XHTML Mobile and accented characters

    Which phone(s)? Tried UTF-8 (Unicode) encoding?

  3. #3
    Registered User
    Join Date
    Mar 2006
    Posts
    3

    Re: XHTML Mobile and accented characters

    With the simulators there are no particular problems but with my Nokia 6630 the characters are completely replaced, also specifying the encoding on the browser of the telephone. For instance the character à is replaced with Ã. and " with an empty square.

    With the encoding UTF-8 unfortunately the visualization worsens. I am thinking about resolving the problem using some functions of PHP to replace the accented characters, the accents and the apostrophes with their equivalent code XHTML. For istance replacing the character of the quotation marks with &quot;
    Last edited by -Francesco; 2006-03-08 at 10:41.

  4. #4
    Registered User
    Join Date
    Mar 2006
    Posts
    3

    Re: XHTML Mobile and accented characters

    At the end I have resolved the problem with some PHP code:

    <?php function entities ( $string ){return str_replace (
    array ( '' , '', "&", "’", ",", "à", "á", "è", "é", "ù", "ú", "ò", "ó", "ì", "ì", "Á", "À", "È", "Í", "Ì", "Ú", "Ù", "Ó", "Ò", "“", "”", "«", "»" ),
    array ( '' , '"', "&" , "'" , "&cedil;", "a'", "a'", "e'", "e'", "u'", "u'", "o'", "o'", "i'", "i'", "A'", "A'", "E'", "I'", "I'", "U'", "U'", "O'", "O'", '"', '"', "&laquo;", "&raquo;" ), $string );}

    $row_article_list['titolo'] = entities($row_article_list['titolo']);
    $row_article_list['sottotitolo'] = entities($row_article_list['sottotitolo']);
    $row_article_list['testo'] = entities($row_article_list['testo']); ?>

    with this solution the encoding is probably superfluous, but as we tell Italy: "A mali estremi, estremi rimedi".

Posting Permissions

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