I'm having a nice character-encoding problem here. I've got an xml-document (see here but with ä ü and ö) which is encodet ISO-8859-1. It is received by HTTP via
First of all: How can it be that I have an ISO-8859-1 string in an 8-bit descriptor? I thought this had to be 16bit? But if I display the whole XML-string, it displays correctly.
// Get the body data supplier
MHTTPDataSupplier* body = aTransaction.Response().Body();
Now I'd like to parse this body using CParser. Doing this, i always get Âx in my output with x being different for different characters like ö,ä or ü. Now, I've found in the forum that CParser accepts only UTF-8 so i tried to convert it to this doing
but then i got my Â even doubled and received ÂÂx in the output. I've also read in Paul Todd's blog:
//put the TDesC8 in TDesC16
//convert to UTF-8
//start XML parser
but I don't know how I should do that. my OnContentL only does
Also can be a bit strange that the data is all in ASCII (UTF8 IIRC) and so you need to convert it to unicode or handle it as ASCII.
no where the hell should I even start?
void CXmlHandler::OnContentL( const TDesC8 &aBytes, TInt aErrorCode )
aBuffer = HBufC::NewL( aBytes.Length() );
aBuffer->Des().Copy( aBytes );
Thanks to all of you!