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

  • Thread starter Thread starter Boki
  • Start date Start date
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.
 
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
 
Back
Top