473,777 Members | 1,732 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to output a Unicode character?

I mean how to use _tprintf().
Jul 19 '05 #1
5 5199
WW
Michael wrote:
I mean how to use _tprintf().


The way the manufacturer of _tprintf() tells you. Standard C++ has no
_tprintf().

--
WW aka Attila
Jul 19 '05 #2
Then how to output a Unicode character using Standard C++ (Pure C++).
Jul 19 '05 #3
WW
Michael wrote:
Then how to output a Unicode character using Standard C++ (Pure C++).


I have no idea. But do not despair! If you get no useful answer here, post
the question to comp.lang.c++.m oderated. There are guys there who work
heavily with UNICODE.

--
WW aka Attila
Jul 19 '05 #4
Michael wrote:
Then how to output a Unicode character using Standard C++ (Pure C++).


Standard C++ does not require that an implementation support, or know
anything about Unicode.

The (sort of) portable answer, then, is to determine the values of the
bytes making up the character you want to output, then write those bytes
to your output stream.

-Kevin
--
My email address is valid, but changes periodically.
To contact me please use the address from a recent posting.

Jul 19 '05 #5
Kevin Goodsell wrote:
Michael wrote:
Then how to output a Unicode character using Standard C++ (Pure C++).


Standard C++ does not require that an implementation support, or know
anything about Unicode.

The (sort of) portable answer, then, is to determine the values of the
bytes making up the character you want to output, then write those bytes
to your output stream.


In other words, write your own wide_char read/writers. You will
probably have to open your stream in binary mode and read/write byte by
byte. Some of those bytes may be standard characters, others my be
encoded Unicode wide chars.

You will want to research how the target system represents unicode in
text streams. In unix this is UTF-8 encoding, others may be same or
different.

Have fun,
NR

Jul 19 '05 #6

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

Similar topics

23
25950
by: Hallvard B Furuseth | last post by:
Has someone got a Python routine or module which converts Unicode strings to lowercase (or uppercase)? What I actually need to do is to compare a number of strings in a case-insensitive manner, so I assume it's simplest to convert to lower/upper first. Possibly all strings will be from the latin-1 character set, so I could convert to 8-bit latin-1, map to lowercase, and convert back, but that seems rather cumbersome.
8
2954
by: Marko Faldix | last post by:
Hello, with Python 2.3 I can write umlauts (a,o,u umlaut) to a file with this piece of code: import codecs f = codecs.open("klotentest.txt", "w", "latin-1") print >>f, unicode("My umlauts are ä, ö, ü", "latin-1")
6
2785
by: S. | last post by:
if in my website i am using the sgml { notation, is it accurate to say to my users that the site uses unicode or that it requires unicode? is there a mathematical formula to calculate a unicode value given its utf8 value? Rgds, Sam
4
3171
by: Basil | last post by:
Hello. I have compiler BC Builder 6.0. I have an example: #include <strstrea.h> int main () { wchar_t ff = {' s','d ', 'f', 'g', 't'};
2
1725
by: Lionel Fourquaux | last post by:
In .Net 1.1, System.Xml.Xsl.XslTransform cannot output directly a document in an encoding that cannot represent all the characters used (e.g. write in us-ascii for compatibility, and convert all non-ascii chars to entities). While it can be worked around (by defining a TextWriter that does the conversion to entities), it's not very elegant (because the information on encodings must be duplicated outside the XSLT file) and breaks...
11
5220
by: Roger Leigh | last post by:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 The program listed below demonstrates the use of wcsftime() and std::time_put<wchar_t> which is a C++ wrapper around it. (I know this isn't C; but the "problem" lies in the C library implementation of wcsftime()). I'm not sure if this is a platform-dependent feature or part of the C standard. I've compiled with GCC 3.4.3 on GNU/Linux, and run in an en_GB UTF-8
5
6345
by: Lyle | last post by:
How do get a line control on the end of a line using the streamwriter.writeline (not carriage line control)? How do you get the following command to print a quote in the file? I have tried using double quotes as shown below but this is not working. outfilew.WriteLine(""@@BATCHLOAD glrtmt.p"") THANKS! From http://www.developmentnow.com/g/38_2005_8_0_22_0/dotnet-languages-vb.htm
13
3314
by: Tomás | last post by:
Let's start off with: class Nation { public: virtual const char* GetName() const = 0; } class Norway : public Nation { public: virtual const char* GetName() const
2
5770
by: Michael B. Trausch | last post by:
I am having a slight problem with UTF-8 output with Python. I have the following program: x = 0 while x < 0x4000: print u"This is Unicode code point %d (0x%x): %s" % (x, x, unichr(x)) x += 1
0
9628
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9464
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10292
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10061
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9923
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8954
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7471
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6722
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
2
3627
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.