Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#2 internal file with special char can't be open

open
nobody
None
5
2008-05-12
2008-05-12
Anonymous
No

I try with a chm file that contain internal file with special char like:
web sg.html(contain a space)
the app just tell me file not found !

After reading the src , I fix by adding decode url in cn.rui.chm.protocol.chm.Handler.openConnection:
protected URLConnection openConnection(URL u) throws IOException {
return new URLConnection(u) {

@Override
public InputStream getInputStream() throws IOException {
CHMFile chm = files.get(url.getHost());
if (chm == null)
throw new IOException("CHMFile not opened");

return chm.getResourceAsStream(URLDecoder.decode(url.getFile()));
}

I think the reason is , url will be encode first before calling this method , so decode is needed . But i don't konw how to get the right charset to decode

Discussion

  • Jammy Lee
    Jammy Lee
    2008-05-12

    Logged In: YES
    user_id=2082849
    Originator: NO

    it is Submitted by me , forget to login right now