Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c++ > #6698 > unrolled thread

I dont't understand UNICODE issues...

Started by"anern" <anern@anern.anern>
First post2011-06-13 16:08 +0100
Last post2011-06-13 15:24 +0000
Articles 2 — 2 participants

Back to article view | Back to comp.lang.c++


Contents

  I dont't understand UNICODE issues... "anern" <anern@anern.anern> - 2011-06-13 16:08 +0100
    Re: I dont't understand UNICODE issues... drew@furrfu.invalid (Drew Lawson) - 2011-06-13 15:24 +0000

#6698 — I dont't understand UNICODE issues...

From"anern" <anern@anern.anern>
Date2011-06-13 16:08 +0100
SubjectI dont't understand UNICODE issues...
Message-ID<dKpJp.2950$c34.634@newsfe17.ams2>
And now I have a new one....
I've just started using boost and I decided to change some of my code over
from using time_t stuff to using ptime stuff. I try a test project (VC2008
express):

#include "boost/date_time/gregorian/gregorian.hpp"
#include "boost/date_time/posix_time/posix_time.hpp"
#include <fstream>
using namespace std;
using namespace boost::gregorian;
using namespace boost::posix_time;

int main()
{
 ptime stamp=microsec_clock::local_time();
 wfstream Logfile("xxx.txt",ios::out | ios::trunc);
 Logfile << stamp;
}

and it works. "Use Unicode Character Set" is used.
I put identical code into a more complex project (with clr) and I get a
debug assertion Failed (sic !)!
File: f:\dd\vctools\crt_bld\self_x86\crt\src\dbgheap.c  (I've no folder
called f:\dd on my machine)
Expressions _crtisvalidheappointer(puserdata)

and I track the assertion down to a line of code in time_facet.hpp line
1511. which is :

ss << ' ' << zone_abbrev_format;

I change the line to

ss << L' ' << zone_abbrev_format;
and it works.
ss expands in the debugger to
std::basic_ostream<wchar_t,std::char_traits<wchar_t> > = {...}

There are sooooo many things I don't understand about this : Why the code
works in one place an not another, where this non-existent f:\dd folder
comes from, if I really have to use the L"xyz" and L'x' syntax for my
unicode strings and chars (cos the library doesn't). Maybe I should go back
to writing my own library code... at least I know how it works..
Help endlessly appreciated.

Bruce.




[toc] | [next] | [standalone]


#6701

Fromdrew@furrfu.invalid (Drew Lawson)
Date2011-06-13 15:24 +0000
Message-ID<it5a2h$2qtu$1@raid.furrfu.com>
In reply to#6698
In article <dKpJp.2950$c34.634@newsfe17.ams2>
	"anern" <anern@anern.anern> writes:

>I put identical code into a more complex project (with clr) and I get a
>debug assertion Failed (sic !)!
>File: f:\dd\vctools\crt_bld\self_x86\crt\src\dbgheap.c  (I've no folder
>called f:\dd on my machine)

Looking at the path, that appears to be a file in Microsoft's CRT code.

(I have no clue on the other problem.)

-- 
 Drew Lawson              What would Brian Boitano do?

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.c++


csiph-web