Re: URL filter and URL encoding problem

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Ivan Brugiolo :
Thank you very much! It is very kind of you!
I have resolved it in accord to what you have said!


"Ivan Brugiolo [MSFT] 写道:
"
Your URL below is UTF-8 encoded and then URL-encoded.
Your translation assumes it's only URL-encoded.

--
--
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of any included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm


"flyingco" <zhouyou3000@xxxxxxxxx> wrote in message
news:1164797476.405380.275120@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
1)I have done many tests with UrlEscape(), and I found that UrlEscape
will not encode chinese char.
2)I also found that there are various of URL encoding functions,but
when I use them to encode
"ÖÐÎÄÒ³Ãæ".htm,it will be encoded to "%D6%D0%CE%C4%D2%B3%C3%E6.htm"
,not "%E4%B8%AD%E6%96%87%E9%A1%B5%E9%9D%A2.htm".but What my tdi driver
intercepted was "%E4%B8%AD%E6%96%87%E9%A1%B5%E9%9D%A2.htm".

So far , I have yet not foud the resolution. who can give me some
advice? It had afflicted me for quite a few days.




"flyingco дµÀ£º
"
thanks ,I am try it with your ways

"Max Paklin дµÀ£º
"
UrlEscape/UrlUnescape should do it.

-- Max Paklin.




"Tim Roberts" <timr@xxxxxxxxx> wrote in message
news:9a0cm2156891u1agcpnmrfr22dnak2da6c@xxxxxxxxxx
"flyingco" <zhouyou3000@xxxxxxxxx> wrote:

URL filter and URL encoding problem
I am developing a tdi driver to filter a url.but if the url contains
chinese char,the url will be encoded.
For example :
url:http://194.0.0.84/????????.htm
when my tdi driver intercept the packet, I find that "????????.htm"
has been encoded to "%E4%B8%AD%E6%96%87%E9%A1%B5%E9%9D%A2.htm"
when I decode it with utf8 ,the content still is not decoded;

Right, because that string is not UTF8-encoded. It is URL-encoded.
After
you expand the % strings, THEN you will have a UTF8 string.

I am not aware of any Win32 APIs to decode URLs, so you may have to do
it
by hand.
--
Tim Roberts, timr@xxxxxxxxx
Providenza & Boekelheide, Inc.

.



Relevant Pages

  • Re: Sending floats over a client-server in Smalltalk
    ... The trick is knowing what to decode them ... Then encode the number in the remaining bytes. ... ByteString>>floatAt: byteIndex ... I could then take a string ...
    (comp.lang.smalltalk)
  • Re: URL filter and URL encoding problem
    ... I am developing a tdi driver to filter a url.but if the url contains ... because that string is not UTF8-encoded. ... THEN you will have a UTF8 string. ... I am not aware of any Win32 APIs to decode URLs, so you may have to do it ...
    (microsoft.public.development.device.drivers)
  • Re: URL filter and URL encoding problem
    ... I am developing a tdi driver to filter a url.but if the url contains ... because that string is not UTF8-encoded. ... THEN you will have a UTF8 string. ... I am not aware of any Win32 APIs to decode URLs, so you may have to do it ...
    (microsoft.public.development.device.drivers)
  • Re: URL filter and URL encoding problem
    ... I am developing a tdi driver to filter a url.but if the url contains ... because that string is not UTF8-encoded. ... THEN you will have a UTF8 string. ... I am not aware of any Win32 APIs to decode URLs, so you may have to do it ...
    (microsoft.public.development.device.drivers)
  • Re: How to display unicode with the CGI module?
    ... I am always confused as to which one to use: encode() or decode(); ... Unicode to ascii. ... like "unicode string" and you always need to think about when to ...
    (comp.lang.python)