SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Member
    Join Date
    Jun 2011
    Posts
    16
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Issue with character sets

    The text I retrieve from a site shows strange characters (usually for foreign characters). Is there anything that I can do from this side to show the right characters? Is there a particular encoding on the PHP side that could fix this?

    Here is the text:

    ��Joseph, fils de David, ne crains pas��levangileauquotidien.org

    Saint Ephrem (v. 306-373), diacre en Syrie, docteur de l'�gliselevangileauquotidien.org

    Hymne pour la Nativit�

    Joseph embrassaitle Fils du P�re c�lestecomme un nouveau-n�,et il le servait comme son Dieu.Il s'y complaisaitcomme en la bont� m�me�;et il le r�v�raitlui le juste par excellence (Mt 1,19).Grande �tait sa perplexit�! ��Comment m'est-il donn�,toi le Fils du Tr�s-Haut,d'avoir en toi un fils�?Contre ta m�re je m'irritais,et je pensais la renvoyer.Je ne savais pasqu'en son sein �tait un grand tr�sor,qui dans ma pauvret�soudain me rendait riche.� Le roi Davida surgi parmi mes anc�treset il a ceint la couronne.Qu'il est grand le d�nuemento� je suis parvenu�!Au lieu d'�tre roi je suis ouvrier�;mais une couronne m'est advenuepuisque sur mon c�ur reposele Ma�tre de toutes les couronnes.��levangileauquotidien.org

  2. #2
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    23,598
    Mentioned
    411 Post(s)
    Tagged
    6 Thread(s)
    Quote Originally Posted by mmmosias View Post
    Is there anything that I can do from this side to show the right characters?
    Yes, there should be. Do you know what character encoding your server is using for these pages? And what character encoding do you have on the page itself, if any?

  3. #3
    SitePoint Member
    Join Date
    Jun 2011
    Posts
    16
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I don't really know what encoding is used for the original php page. My page has charset=iso-8859-1. I'd prefer a encoding/decoding script where I wouldn't have to change the charset.

    Thanks.

  4. #4
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    23,598
    Mentioned
    411 Post(s)
    Tagged
    6 Thread(s)
    You can check in your browser what encoding your web server is set to. That setting tends to override anything you have on your page. I Chrome, for example, go to View > Encoding and it will give you an idea of the actual page encoding.

    Generally, UTF-8 is supposed to be the most reliable, as it includes the widest range of characters. (However, according to some, it is not always reliable for European langes with accented characters.)

    You could try uft-8 instead, but you may first need to change your server settings. There are various ways to do that, but you could perhaps also ask your web host about it.


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
  •