SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    SitePoint Zealot phpguru's Avatar
    Join Date
    Sep 2005
    Posts
    189
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    CURL and UTF8 supporting

    i have one site with code:

    <... html code here ...>
    こんにちは
    <... html code here ...>

    i used curl lib to read this page.
    but result return is:

    <... html code here ...>
    ����ɂ���
    <... html code here ...>

    i used utf8_encode , decode... but it takes no effect.
    so then, did CURL support UTF8 ?

  2. #2
    SitePoint Zealot phpguru's Avatar
    Join Date
    Sep 2005
    Posts
    189
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    any one here ?

  3. #3
    SitePoint Zealot phpguru's Avatar
    Join Date
    Sep 2005
    Posts
    189
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    oh man, nobody can resolve this problem?

  4. #4
    SitePoint Zealot phpguru's Avatar
    Join Date
    Sep 2005
    Posts
    189
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    anyone here?
    i don't known what's this hell.

    i can't resolve this error , and understand it
    i used utf8 encoding and decoding, ... tried more ways.
    so then, why the CURL data transfer result is different with my source code.

    -----------------------------------------------------------
    perhaps it's seems the problem with character encoding...

    the first
    こんにちは
    this string's japanese , i can read it on my site

    however, when i used CURL to grab data on this site, i can't read this string

  5. #5
    SitePoint Enthusiast Bellthorpe's Avatar
    Join Date
    Aug 2006
    Posts
    82
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    curl has an active and knowledgeable mailing list. Perhaps you should ask there?

  6. #6
    Non-Member
    Join Date
    Jan 2003
    Posts
    5,748
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Try...

    PHP Code:
    // ...
    $ch curl_init();
          
    curl_setopt$chCURLOPT_ENCODING"UTF-8" ); 
    If that doesn't help, then just pass in an empty string instead, which is used for auto detection I believe,

    PHP Code:
    // ...
    $ch curl_init();
          
    curl_setopt$chCURLOPT_ENCODING"" ); 
    But try the first one first

  7. #7
    SitePoint Wizard silver trophy kyberfabrikken's Avatar
    Join Date
    Jun 2004
    Location
    Copenhagen, Denmark
    Posts
    6,157
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What does your code look like?


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
  •