473,322 Members | 1,566 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Simple UNICODE question

Hi -

I have a question that I am sure is a basic UNICODE question for
anyone out there with UNICODE experience.

I simply would like to see a non-Latin unicode character printed to my
console.

To do that, I have been attempting to:

(a) wcout << (wchar_t)38 << endl; // should print a semicolon
(latin)

and

(b) wcout << (wchar_t)297 << endl; // should print the copyright
symbol (latin supplemental)

or

(c) wcout << (wchar_t)8240 << endl; // should print the permil symbol

I have gotten (a) to work. (b) and (c) do not and I would be
interested to know why. I am assuming that I should also be able to
print out a kanji character or hangul (Korean) character, for example.

I've tried using different console fonts. I am wondering if I need to
setlocale().

Thanks...
Jul 22 '05 #1
3 1750
Roger Thornhill wrote:
Hi -

I have a question that I am sure is a basic UNICODE question for
anyone out there with UNICODE experience.

You'll have to ask this question on whatever group covers your
implementation. C++ doesn't mention UNICODE.
Jul 22 '05 #2

Roger Thornhill wrote:
Hi -

I have a question that I am sure is a basic UNICODE question for
anyone out there with UNICODE experience.

I simply would like to see a non-Latin unicode character printed to my
console.

To do that, I have been attempting to:

(a) wcout << (wchar_t)38 << endl; // should print a semicolon
(latin)

and

(b) wcout << (wchar_t)297 << endl; // should print the copyright
symbol (latin supplemental)

or

(c) wcout << (wchar_t)8240 << endl; // should print the permil symbol

I have gotten (a) to work. (b) and (c) do not and I would be
interested to know why. I am assuming that I should also be able to
print out a kanji character or hangul (Korean) character, for example.

I've tried using different console fonts. I am wondering if I need to
setlocale().

Thanks...


some versions of windows do not support anything other than pure ASCII in
consoles (e.g. the 9x/ME series). I think that those that do (e.g. the NT
platforms) will require you to change the console's code page setting to
whatever locale you are trying to use. I don't *believe* consoles can use
unicode, although I may be wrong...

David

Jul 22 '05 #3
Hi Roger:
"Roger Thornhill" <ke*********@hotmail.com> wrote in message
news:67*************************@posting.google.co m...
Hi -

I have a question that I am sure is a basic UNICODE question for
anyone out there with UNICODE experience.

I simply would like to see a non-Latin unicode character printed to my
console.

To do that, I have been attempting to:

(a) wcout << (wchar_t)38 << endl; // should print a semicolon
(latin)

and

(b) wcout << (wchar_t)297 << endl; // should print the copyright
symbol (latin supplemental)

or

(c) wcout << (wchar_t)8240 << endl; // should print the permil symbol

I have gotten (a) to work. (b) and (c) do not and I would be
interested to know why. I am assuming that I should also be able to
print out a kanji character or hangul (Korean) character, for example.
I wrote something like your code and it worked fine in Windows XP:

wchar_t msg[100];
......
wprintf(L"La cigüeña come ñandúes %s\n", msg);
But when I ported that code to Linux, the console just showed:

La cig
I think that the terminal implementation in Linux does not allow Unicode
characters, but I cannot ensure it.

Best regards
Ernesto

I've tried using different console fonts. I am wondering if I need to
setlocale().

Thanks...

Jul 22 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: sebastien.hugues | last post by:
Hi I would like to retrieve the application data directory path of the logged user on windows XP. To achieve this goal i use the environment variable APPDATA. The logged user has this name:...
9
by: François Pinard | last post by:
Hi, people. I hope someone would like to enlighten me. For any application handling Unicode internally, I'm usually careful at properly converting those Unicode strings into 8-bit strings before...
8
by: pagates | last post by:
Hello, I am playing a little with Encoding, and I have what is possibly (forgive me) a newbie-type question. I have a function that takes a string and a codepage (based upon the basic MSDN...
14
by: abhi147 | last post by:
Hi , I want to convert an array of bytes like : {79,104,-37,-66,24,123,30,-26,-99,-8,80,-38,19,14,-127,-3} into Unicode character with ISO-8859-1 standard. Can anyone help me .. how should...
12
by: Benry | last post by:
I have two machines. Both have Windows xp Pro. Both have Visual Studio 6.0. These two versions differ only in Forms3 version. Machine 1 (M1) has version 11.0.6254, Machine 2 (M2) has version...
5
by: =?Utf-8?B?S2V2aW4gVGFuZw==?= | last post by:
In MFC, CRichEditCtrl contrl, I want to set the codepage for the control to Unicode. I used the following method to set codepage for it (only for ANSI or BIG5, etc, not unicode). How should I...
1
by: =?ISO-8859-1?Q?Tor_Erik_S=F8nvisen?= | last post by:
Hi, A while ago I asked a question on the list about a simple eval function, capable of eval'ing simple python constructs (tuples, dicts, lists, strings, numbers etc) in a secure manner:...
0
by: deloford | last post by:
Hi This is going to be a question for anyone who is an expert in C# Text Encoding. My situation is this: I have a Sybase database which is firing back ISO-8559 encoded strings. I am unable to...
14
by: Russell E. Owen | last post by:
I have code like this: except Exception, e: self.setState(self.Failed, str(e)) which fails if the exception contains a unicode argument. I did, of course, try unicode(e) but that fails. The...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.