[xsd-users] xml_schema::Date and xml_schema::Time are wrong serialized on UNICODE files

Constantin Iacobescu sir.costy at gmail.com
Fri Nov 19 10:46:01 EST 2010


Hello Boris,


I think I found which is the error, but dont know how to solve it...

If you look in the xml file I have sent to you and look at it in a hex
editor
you will see that if you are converting that strange values from hex to dec
you will get the good value of them

Ex:

month in file have the value 0x0c and converted to decimal is 12
hour... in file have the value 0E and converted to decimal is 14
min... in file have the value 23 and converted to decimal is 35
and so on...

On Fri, Nov 19, 2010 at 4:02 PM, Constantin Iacobescu
<sir.costy at gmail.com>wrote:

> Yes, it's really weird.. actually if I look on debugger I can see that the
> strange characters look the same.
> Let say what you see in the file is the integer or short interpreted like a
> char value.
>
> Here is attached a basic xml exported from a test app.
> I use the latest XSD binary and m working on windows and VS2008
>
> The real code I used before discover the error was some like this:
>
> signed short year = 2010;
> signed char month = 12;
> signed char day = 12;
> signed char month = 12;
>
> signed char hour = 14;
> signed char min = 35;
> signed char sec = 42;
>
> std::auto_ptr<LandXML> objLandXML ( new LandXML(xml_schema::Date(year,
> (unsigned short)month, (unsigned short)day),
>
>
> xml_schema::Time((unsigned short)hour, (unsigned short)min, (unsigned
> short)sec),
>
>              L"1.2"));
>
>
> And in this way I could see in debugger that the reinterpreted value of
> month, day, hour, etc to a char is looking the same like in xml file.
>
>
>
>
>
>
>
> On Fri, Nov 19, 2010 at 3:44 PM, Boris Kolpackov <boris at codesynthesis.com>wrote:
>
>> Hi Constantin,
>>
>> Constantin Iacobescu <sir.costy at gmail.com> writes:
>>
>> > And what I get in to the file it is this:
>> > [...]
>> > date="2010-0-0 "
>> > time="0 :0#:42"
>>
>> Hm, this is strange. The symbols that you get are probably different
>> from what I see in the email because of the mail client conversions.
>> Can you create a small but complete test case (schema, driver, and
>> makefile/project file) that reproduces this problem (you can use
>> one of the examples as a base). Also, which compiler/platform are
>> you using?
>>
>> Boris
>>
>
>
>
> --
> Constantin Iacobescu
>



-- 
Constantin Iacobescu


More information about the xsd-users mailing list