[jcifs] Failed to access files on Samba server with path in Chinese

Michael B Allen mba2000 at ioplex.com
Mon Dec 20 08:40:33 GMT 2004


On Mon, 20 Dec 2004 06:19:09 +0000 (UTC)
joller <joller at intumit.com> wrote:

> Hi all, 
>   
>   I've encountered a problem concerning NO-ASCII file name. 
>   When I use jcifs as the client to access a file
>   with Chinese (Big5) characters in its path, 
>   it works well if the server is a Win32 PC.
>   But if the server is a Samba server on Linux, 
>   I fail to read the content of it, though a SmbFile.exists()
>   return true

The Samba server is probably configured to use an 8 bit encoding as
opposed to Unicode. By default jCIFS will use the 'file.encoding' System
property to decode filenames. Therefore jCIFS will only behave properly
with default settings if both the Samba server codepage and the Java VM
file.encoding are compatible. If they are not compatible, you can override
the encoding using the 'jcifs.encoding' property. Such as:

  jcifs.encoding=Big5

Mike

-- 
Greedo shoots first? Not in my Star Wars.


More information about the jcifs mailing list