SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Hybrid View

  1. #1
    SitePoint Evangelist webchalkboard's Avatar
    Join Date
    Jan 2005
    Location
    Bristol, UK
    Posts
    494
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Character Encoding and Funny Characters

    Hi,

    Please can someone give me some advice, we're having problems with character encoding and funny characters being displayed on our sites. Basically we used to develop all our sites using a standard charset=ISO-8859-1 charset.

    But we've since started to use UTF-8, I guess maybe since we started using Wordpress.

    However we've found that when people copy and paste stuff from MS Word for example, it often includes the ` character and other's which aren't in either character set. This means it's replaced with either a wierd question mark or some other characters.

    We've tried str_replace to remove them and also other functions which are supposed to make the content 'compatible' with other types, but nothing seems to work properly.

    Any ideas?

    What is the best character set to develop sites in? We've also noticed problems when we're including an XML feed which is written in UFT-8, on a site which is otherwise encoded in ISO-8859-1 format.

    Many thanks for your help,

    Thanks,
    Tom
    Websites for Sale - Sell websites in a purpose built marketplace
    Then do some Shopping

  2. #2
    SitePoint Evangelist webchalkboard's Avatar
    Join Date
    Jan 2005
    Location
    Bristol, UK
    Posts
    494
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I think I may have found the solution

    Code:
    $description = mb_convert_encoding(html_entity_decode($description), "ISO-8859-1", "UTF-8");
    Haven't tested thoroughly yet, but if anyone else is having similar problems it might be a good starting point.

    Thanks,
    Tom
    Websites for Sale - Sell websites in a purpose built marketplace
    Then do some Shopping


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
  •