Convert double-byte characters as legitimate URL transport strings

xiaoxiao2021-03-06  149

'

Convert double-byte characters as legitimate URL transport strings

FUNCTION

Geturlencodel (Byval URL)

DIM

I, Code geturlencodel

=

""

IF

TRIM

(URL)

=

""

THEN

Exit

FUNCTION

for

i

=

1

TO

Len

(URL) CODE

=

ASC

(

MID

(URL, I,

1

))

IF

code

<

0

THEN

code

=

code

65536

IF

code

>

255

THEN

Geturlencodel

=

Geturlencodel

&

"

%

"

&

Left

(

HEX

(Code),

2

)

&

"

%

"

&

Right

(

HEX

(Code),

2

)

Else

Geturlencodel

=

Geturlencodel

&

MID

(URL, I,

1

)

end

IF

NEXT

end

FUNCTION

转载请注明原文地址:https://www.9cbs.com/read-128379.html

New Post(0)