On Nov 14, 5:58 am, Joes <joyj...@gmail.com> wrote:
> While I'm programming the Android SMTP code,I met a confused problem
> with code similar as the following:
>     String str= "\0" username "\0" passwrd;
> After executed the code, I found "\0" is intepreted as two
> undisplayable char.

I ran a quick test and saw (as others have) that this returns a single-
character string with one character (0), as expected.

(Stretching) if you converted the string to a UTF-8 byte array, you
would see two bytes (0xc0 0x80) due to the way that Java specifies its
"modified UTF-8"; see e.g. 
http://java.sun.com/javase/6/docs/technotes/guides/jni/spec/types.html#wp16542
.  However, I don't see how you would get to something like 65533 (-3)
from there.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to