[Expat-discuss] CRLF conversion question

Armin Bauer armin.bauer at desscon.com
Thu Sep 9 16:18:12 CEST 2004


On Thu, 2004-09-09 at 16:05, Karl Waclawek wrote:
> ----- Original Message ----- 
> From: "Armin Bauer" <armin.bauer at desscon.com>
> Sent: Thursday, September 09, 2004 9:57 AM
> 
> 
> > > Line breaks are reported by Expat as 0x0A, no matter what
> > > the input. So, depending on your platform, convert them back
> > > to the appropriate line break characters.
> > 
> > Yes. That would be one option. The only problem is how the xml document
> > is parsed. The vcard in the cdata section above is parsed into nodes
> > like this:
> > 
> > <cdata>
> > <text>BEGIN:VCARD
> > <text>0x0a
> > <text>VERSION:2.1
> > <text>0x0a
> > ...
> > </cdata>
> > 
> > So... what would be the correct approach? Test if the text node == 0x0a
> > and replace it with 0x0d 0x0a then?
> 
> Yes, that looks good to me.
> Now, if you ever wanted to port your app to Linux, you should
> make the conversion platform dependent.

actually... it runs just on linux. The problem is that the nokia phones
im trying to sync need the vcards to have 0x0d 0x0a (this is how vcards
are specified btw). That really makes me wonder if im the first person
using libwbxml for syncml...

> 
> > > Another option would be to Base64 encode your CDATA section.
> > > You may not even need a CDATA section then, and everything
> > > is preserved as if it were binary.
> > 
> > This wont work unfortunatly, since the wbxml library receives a syncml
> > request (which is an xml document with a vcard in a cdata section). So
> > to be able to convert the vcard to base64 the library would have to
> > detect the CDATA section first...
> 
> OK, I thought you had control over the encoding of the vcard.
> 
> Karl
> _______________________________________________
> Expat-discuss mailing list
> Expat-discuss at libexpat.org
> http://mail.libexpat.org/mailman/listinfo/expat-discuss



More information about the Expat-discuss mailing list