[jcifs] problem encoding

Christopher R. Hertel crh at ubiqx.mn.org
Fri Jan 17 18:04:10 EST 2003


On Fri, Jan 17, 2003 at 12:34:40AM -0500, Allen, Michael B (RSCH) wrote:
:
> > That is only related to the escaping issue in that--if Unicode is not
> > used--an escape sequence may not match the intended character.
> > 
> No. The user would enter and be given Unicode.

...not if they enter an escape sequence.  %B2 is hex value 0xB2.  What the 
user enters is dependant upon what the user thinks is the right hex value.
If the user is looking at a DOS OEM Codepage chart...  Ouch.  See?

> *Always*. At least with jCIFS they will. If a user's terminal is Cp437 the
> JVM file.encoding property will be Cp437 and when the String is read in it
> will automatically be converted to Unicode.

That's good.

> Then even if jCIFS does not negotiate Unicode and the
> jcifs.encoding=ISO8859_1 it will still work if the server is ISO-8859-1 
> (which it is on a domestic Windows install).

That's good.

> > This is a protocol bug, however, and not a problem to be solved in the SMB
> > URL.
> > 
> The bug was solved with Unicode but we still have to support "ASCII" clients
> occationally and you're right in that it has 0 to do with the SMB URL.

It's not ASCII clients, but servers that jCIFS has to worry about.  The
only way that it might be related to the SMB URL is if we added a
?CODEPAGE= parameter so that the user could tell the client which DOS
codepage the server was expecting.  It's ugly as all get-out, and it's
problematic.

Does Java actually have all of the DOS codepages available natively?  
Could jCIFS be told (manually) that the server want's codepage XXX?  If
so, I suppose jCIFS could support a serverCodepage property.  Ick.

Chris -)-----

-- 
Samba Team -- http://www.samba.org/     -)-----   Christopher R. Hertel
jCIFS Team -- http://jcifs.samba.org/   -)-----   ubiqx development, uninq.
ubiqx Team -- http://www.ubiqx.org/     -)-----   crh at ubiqx.mn.org
OnLineBook -- http://ubiqx.org/cifs/    -)-----   crh at ubiqx.org



More information about the jcifs mailing list