In: , , ,
On: 2005 / 01 / 25 Viewed: 70825 times
Shorter URL for this post: http://ozh.in/43

Via How to get rid of invalid UTF-8 characters: to remove them, for example after aggregating del.icio.us or rss feeds, simply use this trick :

  1. $text = iconv("UTF-8","UTF-8//IGNORE",$text);

Shorter URL

Want to share or tweet this post? Please use this short URL: http://ozh.in/43

Metastuff

This entry "Remove Invalid Characters in UTF-8" was posted on 25/01/2005 at 5:34 pm and is tagged with , , ,
Watch this discussion : Comments RSS 2.0.

5 Blablas

  1. 1
    piou France »
    replied, on 27/Jan/05 at 5:54 pm # :

    ah ah
    character encoding is a neverending source of headaches

    UTF-8 should be used if you dont't want to use HTML equivalents of unusual characters in your page (unless your site is in english only)

    but only recent versions of MySQL can manage UTF-8, so that knowing webhosts never upgrade their servers, it's all about converting every time you use a database…

    not to speak of text editors and windows 's false iso charset

    (take a look at wordpress's souce ;)

  2. 2
    Chs South Africa »
    said, on 23/Jun/08 at 11:59 am # :

    Thank you for this, it helped me a lot.

  3. 3
    HighToro Argentina »
    commented, on 30/Mar/09 at 5:45 pm # :

    You're a genious! Tnx a lot!!

  4. 4
    mary Sweden »
    thought, on 04/May/09 at 9:00 pm # :

    thanks, helped me out a lot :)

  5. 5
    Daniel Poland »
    replied, on 04/Jun/09 at 12:02 am # :

    Great code, that helped me a lot! Thanks!

Leave a Reply

Comment Guidelines or Die

  • HTML: You can use these tags: <a href=""> <em> <i> <b> <strong> <blockquote>
  • Posting code: Post raw code (no <> &lt; etc) within appropriate tags : [php][/php], [css][/css], [html][/html], [js][/js], [sql][/sql], [xml][/xml], or generic [code][code]
  • Gravatars: Curious about the little images next to each commenter's name ? Go to Gravatar.
  • Spam: Various spam plugins on patrol. I'll put pins in a Voodoo doll if you spam me.
  • I will mark as Spam test comments, all comments with SEO names (ie "My Cool Online Shop" instead of "Joe") or containing forum-like signatures.

Read more ?