|
-
October 22nd, 2009, 08:52 AM
#7
Re: string comparing
It shouldn't matter what language the webpage is in.
You need to load the page using the right encoding the page was made in. And you should store this in a format that preserves the semantic value of the encoding. You then use a search that's compatible with the storage format used.
Sounds hard ? it isn't.
The page has chinese... This means it is encoded in some kind of format, chinese webpages are usually encoded as UTF-16. But it could be another format, you need to KNOW/DETERMINE which this format is.
You then load the page and convert it to what you're using in your program, and you need to preserve the chinese characters. Meaning... if you have an ansi program, it probably won't work as when converting your UTF-16 with chinese characters to ansi, it won't be able to convert the chinese characters. A good plan would be to create your program as unicode.
You then do the same with the string you want to find, you need to also get it in unicode format.
If you have both the text and the search string in unicode. you can use wcsstr() to see if the page contains the string you seek.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|