Encode Unicodes

Discussion in 'PHP' started by vOlLvEriNe, May 24, 2015.

  1. #1
    Hi folks,
    I'm trying to crawl Arabic data using simple_html_dom, And I'm getting result like this
    Screenshot_17.png
    If I use mb_convert_encoding function, I get the result, but source code like this
    Screenshot_18.png Infect I need to insert it into database, so suggest me your valuable solution.
     
    vOlLvEriNe, May 24, 2015 IP
  2. deathshadow

    deathshadow Acclaimed Member

    Messages:
    9,732
    Likes Received:
    1,999
    Best Answers:
    253
    Trophy Points:
    515
    #2
    Are you sure everything is set for a proper character set encoding supporting those characters -- in terms of the editor and form used to create the data, any database used to store the data, AND in terms of your output? Be sure you've set UTF-8 across the board.

    Though I'm not familiar with "simple_html_dom" -- do you mean this?
    http://simplehtmldom.sourceforge.net/

    If so I'd not be surprised if it doesn't support non latin-1 characters, it seems a little fly-by-night.

    Is there some reason you're using some goofy redundant script instead of DOMDocument?
    http://php.net/manual/en/class.domdocument.php

    Have I ever mentioned how much I hate it when people write libraries, frameworks and other such systems that replicate existing functionality?
     
    deathshadow, May 24, 2015 IP