On Sat, 2003-06-07 at 12:37, Christopher Kohlhaas wrote:
> Hello,
> 
> I've encountered a Problem in SourceResolve with 
> files like:
> 
>   "/tmp/dir with space/fortress.xconf" (contains Spaces)
> 
> or
> 
>   "c:\�bersicht\fortress.xconf" (contains german Umlaute)
> 
> The first one correctly gets encoded to the URI
> 
>   "file:/tmp/dir%20with%20spaces/fortress.xconf"
> 
> The later one gets encoded to 
> 
>   "file:/c:\%c3%9cbersicht\fortress.xconf"
> 
> The encoding could happen for example in the getSystemResource method
> of the classLoader.
> 
>   configURL = ClassLoader.getSystemResource("fortress.xconf");
> 
> The Problem is: The uri will never be decoded in FileSource:
> 
>   public FileSource(String uri) throws SourceException,..
>   {
>       int pos = SourceUtil.indexOfSchemeColon(uri);
>       if (pos == -1)
>       {
>           throw new MalformedURLException("Invalid URI : " + uri);
>       }
> 
>       String scheme = uri.substring(0, pos);
>       // The URI will not be decoded 
>       String fileName = uri.substring(pos + 1);
>       init(scheme, new File(fileName));
>   }
> 
> However under under java 1.3.1 all works fine only java 1.4.1
> fails. Tried to place a decode method, but that only fixed the space
> problem.
> 
> Unfortunatly I've no time to investigate further, so I worked around
> this by not using SourceResolverImpl at all.
> 

Hi Christopher,

I stumbled across the same problem some time ago (in a different
context). I have now comitted changes to do path-decoding in FileSource.
It works fine with your "�bersicht" example, could you give it a try?

Regards,

Bruno

-- 
Bruno Dumon                             http://outerthought.org/
Outerthought - Open Source, Java & XML Competence Support Center
[EMAIL PROTECTED]                          [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to