![]() |
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 |
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 03:03 AM. |
Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.