Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > How to tell if standard input is UNICODE or ANSI text ?

Reply
Thread Tools

How to tell if standard input is UNICODE or ANSI text ?

 
 
terminatorul@gmail.com
Guest
Posts: n/a
 
      01-30-2008
Hello

Sorry if asking a known question.
I have a program that reads lines of text from standard input and
writes the non-empty ones back to standard output.
In most cases it will be used with standard input and output streams
redirected to FS files.

If my input is wide-character (UNICODE) I would like to use wcin and
wcout and write wide-character text to standard output. If my input is
narrow-character I would like to use cin and cout to write narrow-
character text to standard output.

How can I tell if my standard input stream has UNICODE text ?

Thank you,
Timothy Madden,
Romania
 
Reply With Quote
 
 
 
 
Ron Natalie
Guest
Posts: n/a
 
      01-30-2008
wrote:

> How can I tell if my standard input stream has UNICODE text ?
>

What makes you think that wcin has anything to do with UNICODE.
C++ places no such constraint.

You can't tel for sure but there are definite clues. If you
would google
first bytes of unicode file
you'll find what they are. Open the file, read the first few
bytes and see if they match.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
pre-ansi to ansi c++ conversion? Frank Iannarilli C++ 2 07-21-2009 11:05 PM
Are there statistics packages in ANSI C and/or ANSI C++? lbrtchx@gmail.com C Programming 11 04-28-2008 03:00 AM
Are there statistics packages in ANSI C and/or ANSI C++? lbrtchx@gmail.com C++ 1 04-24-2008 06:44 PM
Error in Extending/Embedding FAQ, point 16: How do I tell"incomplete input" from "invalid input"? Dietrich Bollmann Python 0 04-22-2008 03:12 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57