Is it possible to use converted URL by EscapeURL at Get WWW?

Hi,

There is urlencode directory(ex. %EC%B5%9C%EB%82%98%EC%97%B0) in my webserver.

I wanna download file at that directory by WWW class.

So I try this,

WWW data = new WWW(http://xxx.xxx.xxx.xxx/%EC%B5%9C%EB%82%98%EC%97%B0/test.xml);

But, data.text is setted like this.

<-!DOCTYPE HTML PUBLIC “-//IETF//DTD HTML 2.0//EN”>

<-html><-head>

<-title>404 Not Found<-/title>

<-/head><-body>

<-h1>Not Found<-/h1>

<-p>The requested URL xxx/test.xml was not found on this server.<-/p>

<-/body><-/html>

Request URL is modified.(%EC%B5%9C%EB%82%98%EC%97%B0 → xxx)

I wanna set encoded request URL.(ex. %EC%B5%9C%EB%82%98%EC%97%B0)

is it possible?

help please :slight_smile:

I think that all of your % need to be \% in this case.

I'm not sure if your example is your real url, because it doesn't make much sense. (That's what the URL looks like decoded: http://xxx.xxx.xxx.xxx/최나연/test.xml).

Usually only reserved or non ascii characters have to be encoded. You can of course encode every ascii character but i ask my self: why? Do you want to encrypt / hide the folder from the user? That's not really possible. URL encoding is just the ascii code written as hex numbers. It's not really hard to convert that.

Short example:

"%68%65%6C%6C%6F" --> "hello"

If you use one of those many online URL decoders it can tell you the true characters.

Your encoded URL contains UTF-8 encoded characters. So one character is made of multiple bytes:

%EC%B5%9C --> 최

%EB%82%98 --> 나

%EC%97%B0 --> 연

I doubt that you web-server can understand those UTF8 symbols as a valid path of your server.

edit

Maybe i don't understant your actual problem. Do you have a folder on your webserver that's name is "%EC%B5%9C%EB%82%98%EC%97%B0" ? Why would you ever name a folder like that? Esp. in a web context?

However, if the folders real name is like that you might can just encode it once more so the % signes are replaced by %25 (which is the ascii code for %).

So it would be:

%25EC%25B5%259C%25EB%2582%2598%25EC%2597%25B0