Boost logo

Boost Users :

From: Robert Ramey (ramey_at_[hidden])
Date: 2008-08-13 12:44:29


Daniel Krügler wrote:
> Robert Ramey wrote:
>> the wide character xml archives use UTF8.
>>
>> the narrow character xml archives use the currently set locale.
>>
>> Robert Ramey
>
> Sorry for asking offhand:
>
> What is the reasoning behind this different behaviour?

I assumed that most programs built with narrow characters used
the locale concept to deal with this.

Wide character systems lend themselves to UTF coding so I
used that for wide char archives. In order to do this, I used
Ron Garcia's UTF code conversion facet for streams.

It would be quite easy to generate UTF coding for narrow
character archives. Just do the following:

a) Build the UTF code conversion facet for narrow character
input (its templated on character type).

b) When the stream is opened, attach this facet to the stream.

Note the the output char format is not really a property of the
serialization
library, but rather an artifact of the way it has been used. That is, the
serialization library depends on the standard stream library for this
property.

Robert Ramey

> I would have
> expected that in both cases UTF-8 would have been used assuming that
> the xml-encoding is described as UTF-8. But I probably have overlooked
> something very basic?
>
> Thanks for your patience and
>
> Greetings from Bremen,
>
> Daniel


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net