Different encoding? ( problem on Chinese encoding on textbox ... )

B

Boki

Hi All,

Here is the code:

Shell("D:\Program Files\Mozilla Firefox\firefox.exe
http://tw.dictionary.yahoo.com/search?ei=UTF-8&p=" & TextBox1.Text)


If I type English word in TextBox1, I can get correct result, but if I
type Chinese, the result is wrong. It seems that they use different
encoding? am I right? Could you please advice how to solve this
problem?

Thank you very much!

Best regards,
Boki.
 
C

Carlos J. Quintero [VB MVP]

Hi Boki,

Just some pointers:

Even if it was plain english, you would have to encode for URL (spaces,
especial characters, etc.). Take a look at the function
System.Web.HttpUtility.UrlEncode (there are overloaded variants to accept an
string or bytes array)

And since it is Chinese, you may also need to encode using
System.Text.Encoding.GetString or GetBytes for the desired encoding (UTF8,
Unicode, etc.)

--

Best regards,

Carlos J. Quintero

MZ-Tools: Productivity add-ins for Visual Studio
You can code, design and document much faster:
http://www.mztools.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top