« Return to Thread: URIResolver in combination with filenames with unicode characters fails - Problem in AbstractImageSessionContext#toFile?

Re: URIResolver in combination with filenames with unicode characters fails - Problem in AbstractImageSessionContext#toFile?

by Peter Coppens :: Rate this Message:

Reply to Author | View in Thread

Thanks Andreas.

Line nrs  in AbstractImageSessionContext do not match with what I see but I am not using trunk.

What I found out debugging is that the A9C3 character is escaped as %A9%C3 when the url is contructed but that in the toFile method %A9 and %C3 are interpreted as 2 different characters.

I am also confused on why you get

        "resolve on héxlæ.png canRead returns false"

Perhaps your machine/filesystem is not using utf8 and/or saving the file did not use utf8 or something like that

I don't mind rewriting the URI resolver in whatever way to make it work bit FOP. For now I have something very ugly hacked in, but at least that is working

It looks like

class MyStreamSource extends StreamSource {
  private File file;

  public MyStreamSource(File f) {
    super(f);
    this.file=f;
  }
 
  @Override
  public String getSystemId() {
    return this.file.getAbsolutePath();
  }
 
  @Override public InputStream getInputStream() {
    try {
      return new FileInputStream(file);
    } catch (FileNotFoundException e) {
      return null;
    }
  }
 
}


Any other advice more than welcome.

Thanks,

Peter

 « Return to Thread: URIResolver in combination with filenames with unicode characters fails - Problem in AbstractImageSessionContext#toFile?