-
October 20th, 2009, 08:13 AM
#1
string comparing
i am using vista english edition
i have a chinese file my friend sent me
i open it with notepad and turn of search string capability, it can read in the odd chinese characters and search correctly the occurences of the pattern given in the "find:textbox"
i don't know how my browser (ie english edition) can do that
how can i write a function to search a chinese pattern in a web page content ?
can you offer me the code you wrote for ie browser ?
thanks
-
October 20th, 2009, 08:45 AM
#2
Re: string comparing
Can you use CString class or wstring of STD (nah-not that abrieviation but I do sometimes consider Std is just that sort of shortened form) ?
You read the content into a string then use Find to search for the pattern
-
October 21st, 2009, 08:19 AM
#3
Re: string comparing
thank you but can you post/give me the source code ?
it doesn't seem people are willing to help me
-
October 21st, 2009, 10:05 AM
#4
Re: string comparing
He doesn't seem like you are willing to help yourself.
-
October 22nd, 2009, 07:29 AM
#5
Re: string comparing
Yes, helping yourself first before asking us to help you, this is the first step towards IT industry and the Standards
-
October 22nd, 2009, 08:41 AM
#6
Re: string comparing
Originally Posted by jnmacd
He doesn't seem like you are willing to help yourself.
thank you
that is dependent, if you wish to tell me that, and i like to depend on people like you now right now, really love to be dependent, please let me cling on you, stick with you and grab you tighter for now and for always....
so can you please show me what such a dependent part offers me as a solution to the problem i am having ?
i would like to read a music lyrics website that is encoded in Spainish
-
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.
-
October 22nd, 2009, 07:35 PM
#8
Re: string comparing
but after i read the page in to edit some parts then the writing back becomes tricky and flawful
since the new webpage's not as previously encoded anymore, all the characters become 2 byte encoded.
i say "all" because even the ascii's characters are reencoded, which is completely wrong. this is why i ask for the offerings of any code piece from people.
but at the same time i think their intention is to use codesnips as part of micosoft trade or to show off infront of colleagues that they know the problems and they actually code better, nyew nuew nyee nee
thank anyway, sure i am going to give up in despair as expected and to me it is always "its better NEVER than late". timing needs to be obeyed, punctuality is one of the best features to earn creditability. i am late to complete my application therefore i waste time of many others.
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
|