[jcifs] JCIFS and Share name with German character
Michael B Allen
ioplex at gmail.com
Wed Dec 2 14:50:16 MST 2009
On Wed, Dec 2, 2009 at 1:57 PM, Peter Zavadsky
<peter_zavadsky at symantec.com> wrote:
> Hi,
>
> I hit following issue with JCIFS when the share name contains German character ß
> (or similar).
> See the following code snippet:
>
> Config.registerSmbURLHandler();
> SmbFile smbFile = new SmbFile("smb://hostname/Shareß/");
> //SmbFile smbFile = new SmbFile("smb://hostname/Share%C3%9F/"); // same problem
> smbFile.exists();
>
> It throws exception:
> jcifs.smb.SmbException: The network name cannot be found.
>
> Is there some configuration setting I am missing?
That should work provided that the actual string supplied to the
SmbFile constructor is in the right encoding. For example, if your on
UNIX and your editor is running in a latin1 mode but javac is
expecting a UTF-8 string literal, the ß might look right in the code
but at runtime it would be in the wrong encoding.
Or the problem could be on the server if it were like an old NetApp
server running in a latin1 locale.
If you send me a packet capture I could at least tell you from which
end the problem is originating.
Or it could be a bug in JCIFS. I vaguely recall something like this
where Unicode values like this needed to be URL encoded but JCIFS
didn't properly decode them internally and some extra funky step was
required.
Mike
--
Michael B Allen
Java Active Directory Integration
http://www.ioplex.com/
More information about the jCIFS
mailing list