On my CentOS box, in C++ programs, is there a way to print Unicode characters?
Thanks, Mike.
On Tue, 22 Feb 2011 23:53:20 +0100, Nicolas Thierry-Mieg wrote:
Michael D. Berger wrote:
On my CentOS box, in C++ programs, is there a way to print Unicode characters?
google knows...
I haven't found it. Please see the other response I just sent for clarification of what I need.
Thanks, Mike.
On Wed, Feb 23, 2011 at 02:46:24PM +0000, Michael D. Berger wrote:
On Tue, 22 Feb 2011 23:53:20 +0100, Nicolas Thierry-Mieg wrote:
Michael D. Berger wrote:
On my CentOS box, in C++ programs, is there a way to print Unicode characters?
google knows...
I haven't found it.
Strange. "Using Unicode in C/C++":
http://evanjones.ca/unicode-in-c.html
pops on top of a plain search for "unicode c++" in Google:
http://www.google.it/search?q=unicode+c%2B%2B
Mihai
On Wed, 23 Feb 2011 17:01:37 +0100, Mihai T. Lazarescu wrote:
[...]
Thanks, I did a slightly different search and I didn't get such good results.
Mike.
On 02/22/11 2:37 PM, Michael D. Berger wrote:
On my CentOS box, in C++ programs, is there a way to print Unicode characters?
if you're running in an xterm that's configured for UTF8, or a ssh session to console that's configured for UTF8, then yes. if you're running on a textmode console in VGA mode, probably not.
On Tue, Feb 22, 2011 at 5:37 PM, Michael D. Berger m_d_berger_1900@yahoo.com wrote:
On my CentOS box, in C++ programs, is there a way to print Unicode characters?
Thanks, Mike.
Why do you want to? And what sort of monitor or client are you using? Xterm, Putty, NX, SSH,
And what do you mean by "print"? Do you mean send to a printer, or get them to display correctly on your screen?
On Tue, 22 Feb 2011 19:51:38 -0500, Nico Kadel-Garcia wrote:
On Tue, Feb 22, 2011 at 5:37 PM, Michael D. Berger m_d_berger_1900@yahoo.com wrote:
On my CentOS box, in C++ programs, is there a way to print Unicode characters?
Thanks, Mike.
Why do you want to?
Off topic.
And what sort of monitor or client are you using? Xterm, Putty, NX, SSH,
Xterm.
And what do you mean by "print"? Do you mean send to a printer, or get them to display correctly on your screen?
cout << <Unicode characters> << endl;
and they will appear on my screen, or:
ofstream os("myfile"); os << <Unicode characters> << endl;
And they will appear in myfile which may them be printed or edited with vi.
Thanks, Mike.
On Wed, Feb 23, 2011 at 02:44:11PM +0000, Michael D. Berger wrote:
On Tue, 22 Feb 2011 19:51:38 -0500, Nico Kadel-Garcia wrote:
On Tue, Feb 22, 2011 at 5:37 PM, Michael D. Berger m_d_berger_1900@yahoo.com wrote:
On my CentOS box, in C++ programs, is there a way to print Unicode characters?
And what sort of monitor or client are you using? Xterm, Putty, NX, SSH,
Xterm.
Make sure to use uxterm, not xterm. (Should be included with any installation of xterm.)
And what do you mean by "print"? Do you mean send to a printer, or get them to display correctly on your screen?
cout << <Unicode characters> << endl;
and they will appear on my screen, or:
ofstream os("myfile"); os << <Unicode characters> << endl;
And they will appear in myfile which may them be printed or edited with vi.
Depending upon the characters, you may not be able to get them in a console, but as long as you're using X, they should appear in an xterm.
On Wed, Feb 23, 2011 at 9:44 AM, Michael D. Berger m_d_berger_1900@yahoo.com wrote:
On Tue, 22 Feb 2011 19:51:38 -0500, Nico Kadel-Garcia wrote:
On Tue, Feb 22, 2011 at 5:37 PM, Michael D. Berger m_d_berger_1900@yahoo.com wrote:
On my CentOS box, in C++ programs, is there a way to print Unicode characters?
Thanks, Mike.
Why do you want to?
Off topic.
*Very* relevant. If it's for a specific app, or for parsing inputs from web forms, or handling Kanji from PDF for pstext output, or emacs editing over a serial port, it matters.
The same as on any other Linux box.
Some important tips for beginners:
* Don't forget to set your locale appropriately at the beginning of your program.
* Use ONE encoding CONSISTENTLY (utf-8 or utf-16) inside your program, and trans-code appropriately to/from outer encodings (all such transcoding should happen at the IO edges). If using UTF-16, make sure you standardise on an byte order if you are storing the files. UTF-8 doesn't have that issue. US-ASCII is also UTF-8 (the reverse is not true).
* Do not mix data representations. As much as you can, try to stay with either wide-characters (where every character is represented as a single 32-bit codepoint) or multi-byte (eg. UTF-8, UTF-16).
* Yes, UTF-16 is also a multi-byte character set.
* Learn about Unicode Normalisation: it is important when comparing strings. It is VERY IMPORTANT when comparing strings in a security context.
* Software you will want to learn: libiconv for transcoding. IBM's Components for Unicode (ICU). This is a large suite of commonly needed Unicode algorithms that libc doesn't have.
Hope it helps, Cameron
On 23/02/2011, at 11:37 AM, Michael D. Berger wrote:
On my CentOS box, in C++ programs, is there a way to print Unicode characters?
Thanks, Mike.
CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos