Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   C++ (http://www.velocityreviews.com/forums/f39-c.html)
-   -   How to tell if standard input is UNICODE or ANSI text ? (http://www.velocityreviews.com/forums/t588256-how-to-tell-if-standard-input-is-unicode-or-ansi-text.html)

terminatorul@gmail.com 01-30-2008 09:12 AM

How to tell if standard input is UNICODE or ANSI text ?
 
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

Ron Natalie 01-30-2008 12:37 PM

Re: How to tell if standard input is UNICODE or ANSI text ?
 
terminatorul@gmail.com 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.


All times are GMT. The time now is 11:30 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.