Jump to content
Sign in to follow this  
DHW

_FFXpath returns Chinese string in wrong coding

Recommended Posts

I got problem  retrieving UTF-8 Chinese textcontent from webpage.

<a href="/index/XAU.php">費城金銀</a>
#Include <FF.au3>

_FFConnect()

$sExpect= "費城金銀"    ;the expected result
$sReturn=_FFXPath("//a[@href = '/index/XAU.php']","textContent",2)

msgbox(4096, "", "$sExpect" & @crlf & $sExpect & @crlf & @crlf & _
    "$sReturn" & @crlf & $sReturn & @crlf & @crlf & _
    "binaryToString(stringToBinary($sReturn,1),4)" & @crlf & binarytostring(stringToBinary($sReturn,1),4)& @crlf & @crlf & _    ;convert it back to UTF-8, but only 1 character is correct.
    "binaryToString(stringToBinary(binaryToString(stringToBinary($sExpect,4),1),1),4)" & @crlf & binarytostring(stringtobinary(binarytostring(stringToBinary($sExpect,4),1),1),4))  ;simulate the error.

Does anybody know the way to retrieve textcontent in UTF-8 directly instead of ANSI?

Thanks for your help!

 

Edited by DHW

Share this post


Link to post
Share on other sites

Please try to stick to English:

Quote

I have encountered this problem, I do not know how to solve? Character is lost, there is still garbled?

Jos


SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
2 hours ago, diandiand163 said:

高手都在干嘛,为什么没来解决啊?

Masters are doing, why not to solve ah?

Sigh .. ENGLISH PLEASE! (请说英语!)

Edited by Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...