Skip to main content

Type of URL Encoding for the return value of ClassLoader#getResource()

No replies
zzfjjp28
Offline
Joined: 2005-04-05
Points: 0

Hi,

I wonder what is the 2-byte character encoding type for the return URL instance of java.lang.ClassLoader.getResource() method.

Logic below seems to work fine :

String path = URLDecoder.decode(fileUrl.getPath(), "UTF-8");

But, I can't assure that the type of encoding is always "UTF-8" at Sun JRE.

Can I beleve that is "UTF-8"?

help!

Sincerely,