Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
how to read a Unicode file with fstream?
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  3 messages - Expand all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
P.J. Plauger  
View profile  
 More options May 25 2004, 12:04 pm
Newsgroups: microsoft.public.vc.stl
From: "P.J. Plauger" <p...@dinkumware.com>
Date: Tue, 25 May 2004 12:04:20 -0400
Local: Tues, May 25 2004 12:04 pm
Subject: Re: how to read a Unicode file with fstream?
"ss" <anonym...@discussions.microsoft.com> wrote in message

news:D37A849F-5D40-484F-965F-28CD81BCFA1C@microsoft.com...

mbstowcs function to convert the data to wide character, but, the file had
been a Unicode file!

> how to do?

Depends on what you mean by a Unicode file. I suspect you want one of:

UTF-8
UCS-2BE
UCS-2LE
UTF-16BE
UTF-16LE

If so, then see our CoreX add-on library -- there's an online reference
manual for it
at our web site. It has all these conversions, and then some.

HTH,

P.J. Plauger
Dinkumware, Ltd.
http://www.dinkumware.com


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
David Lowndes  
View profile  
 More options May 25 2004, 12:11 pm
Newsgroups: microsoft.public.vc.stl
From: David Lowndes <dav...@example.invalid>
Date: Tue, 25 May 2004 17:11:05 +0100
Local: Tues, May 25 2004 12:11 pm
Subject: Re: how to read a Unicode file with fstream?

>but, the result was too bad, i trace it, i found the wfstream used mbstowcs function to convert the data to wide character, but, the file had been a Unicode file!
>how to do?

A unicode text file has a marker at the start that you probably need
to detect before you try reading the strings. See the "Byte-order
Mark" topic in MSDN.

Dave
--
MVP VC++ FAQ: http://www.mvps.org/vcfaq


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Igor Tandetnik  
View profile  
 More options May 25 2004, 12:23 pm
Newsgroups: microsoft.public.vc.stl
From: "Igor Tandetnik" <itandet...@mvps.org>
Date: Tue, 25 May 2004 12:23:41 -0400
Local: Tues, May 25 2004 12:23 pm
Subject: Re: how to read a Unicode file with fstream?
"ss" <anonym...@discussions.microsoft.com> wrote in message

news:D37A849F-5D40-484F-965F-28CD81BCFA1C@microsoft.com

> read a text and display it.
> now, i want to change it, to read a Unicode-Text file.

See
http://groups.google.com/groups?threadm=3e1b5aea_1%40corp.newsgroups.com
--
With best wishes,
    Igor Tandetnik

"For every complex problem, there is a solution that is simple, neat,
and wrong." H.L. Mencken


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google