Yeah, Jonas here :)

Well, this is my code, and I think you may have a point there, I sould
set the output encoding to UFT-8, right?

XmlSerializer serializer = Xml.newSerializer();
StringWriter writer = new StringWriter();
serializer.setOutput(writer);
serializer.startDocument("utf-8", null);

The problem is that the serializer.setOutput() takes an encoding but
then I have to send an OutputStream as the the argument
"serializer.setOutput(os, encoding);", and I'm not sure I'm able to do
that, or more true, I don't know how to do that.

Any hint?

On May 4, 9:03 pm, "Jonas Petersson" <[email protected]> wrote:
> Hi again Jonas (?),
>
>
>
> jw wrote:
> > Well, all I want to is to send the string forward in an xml string.
> > The flow is like this:
>
> > User fills in a couple of forms (EditText) and presses a button. The
> > values is added into an xml string and posted.
>
> > The thing is when I print the values in the Log cat, it looks weired.
> > And the the result on the receiving end is ??? (all едц becomes
> > question marks).
>
> > So what I want to do is simply send the values as utf-8 in the xml
> > string. That's it.
>
> > So I agree with you, I should keep it as UTF-8. But I'm not following
> > you on what I am able to do?
>
> I'd just ensure the XML file is indeed UTF-8 encoded and ignore anything
> you may find odd in logcat - I'm not 100% sure logcat is UTF-8 safe and
> even if it is in itself, it still depends how you view it - I prefer
> running ./adb logcat in a fairly sized up window rather than what
> eclipse offers and therefore the logcat output will depend on how my
> xterm is setup. Basically, logcat is for trace output - don't worry
> about the encoding there as long as the end result is correct.
>
> BTW: if you are concerned with the size of the data being sent between
> your phone to the server, I'd seriously recommend gzipped JSON over XML,
> but that's just me...
>
>                 Best / Jonas (too)
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group 
> athttp://groups.google.com/group/android-developers?hl=en

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

Reply via email to