[jcifs] Why would auth work on one server and not on
another?
Allen, Michael B (RSCH)
Michael_B_Allen at ml.com
Fri Jul 11 15:38:56 EST 2003
> -----Original Message-----
> From: Dave Mobley [SMTP:scprotz at hotmail.com]
>
> 3. (THIS IS A BIG ONE) Mozilla REALLY REALLY wants to try to authenticate
> with my servlet (even though it isn't the nice automatic NTLM - it requires
> me to enter my credentials) on Domino (and even does the full handshake, but
> jcifs uses the "UnicodeLittleUnmarked" encoding, which Domino's JDK (its an
> old 1.1) doesn't understand.
>
> Any suggestions on a 1.1 substitute for "UnicodeLittleUnmarked"? (Or will I
> have to write some sort of byte converter, and then convert it to a String
> with another encoder that is much more jdk1.1. friendly)?
>
Well since Java strings are already Unicode it's just a matter of converting each
char into a two byte sequence so this should do it. Just replace each call
str.getBytes( "UnicodeLittleUnmarked" ) with UnicodeVeryLittle.getBytes( str ).
Mike
package jcifs.smb;
public class UnicodeVeryLittle {
static byte[] getBytes( String str ) {
char[] input = str.toCharArray();
byte[] output = new byte[input.length * 2];
int i, o;
o = 0;
for (i = 0; i < input.length; i++) {
ServerMessageBlock.writeInt2( input[i] & 0xFFFFL, output, o );
o += 2;
}
return output;
}
}
More information about the jcifs
mailing list