SitePoint Sponsor

User Tag List

Results 1 to 9 of 9
  1. #1
    if ($zee == "Guru") { $zee--;}
    Join Date
    Nov 2005
    Location
    Karachi - Pakistan
    Posts
    1,133
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    European Characters issue !

    Hi

    I have a script that scrapes data from a webpage. There are some names in the webpage that has European characters. Like :

    Code:
    Rapid Bucureşti
    Šempeter pri Gorici
    FC Sochaux-Montbéliard
    My script collects the data and then put that in to a MySQL database, and then another script pull the data from the database and generate an excel report. The european characters are not correctly shown in the excel report.

    for example, FC Sochaux-Montbéliard is shown as FC Sochaux-Montbéliard
    Here are some detail:

    1) I have "charset=utf-8" in the meta charset declaration in the scripts.
    2) The table in the database is of latin1_swedish_ci collation.

    Please guide me how to resolve the issue.

  2. #2
    SitePoint Wizard
    Join Date
    Mar 2008
    Posts
    1,149
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    But is the encoding of the page you are scraping from in UTF-8?

  3. #3
    if ($zee == "Guru") { $zee--;}
    Join Date
    Nov 2005
    Location
    Karachi - Pakistan
    Posts
    1,133
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    yes and on that page every thing looks fine .

  4. #4
    if ($zee == "Guru") { $zee--;}
    Join Date
    Nov 2005
    Location
    Karachi - Pakistan
    Posts
    1,133
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi

    I have just echo the data before storing it into the database, and it looks PERFECT in the browser !

    But when it is stored in the mysql database, and I browse the data, it looks ugly again !

    Please somebody help me !

  5. #5
    SitePoint Wizard co.ador's Avatar
    Join Date
    Apr 2009
    Posts
    1,054
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Facing the same issues did you checked the character encoding string fuctions?

  6. #6
    if ($zee == "Guru") { $zee--;}
    Join Date
    Nov 2005
    Location
    Karachi - Pakistan
    Posts
    1,133
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    no no , please tell me what those functions ?

  7. #7
    SitePoint Wizard co.ador's Avatar
    Join Date
    Apr 2009
    Posts
    1,054
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Read this thread

    http://www.sitepoint.com/forums/showthread.php?t=631407

    This thread is four thread below this one. It will surely help you. the steps of dealing with this encoding characters are there and we still figuring it out. Hope it serves

  8. #8
    if ($zee == "Guru") { $zee--;}
    Join Date
    Nov 2005
    Location
    Karachi - Pakistan
    Posts
    1,133
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I have tried that and nothing works !

  9. #9
    if ($zee == "Guru") { $zee--;}
    Join Date
    Nov 2005
    Location
    Karachi - Pakistan
    Posts
    1,133
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi

    I have just solved my issue. Just make use of utf8_decode() and it worked !


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
  •