🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #2342

Re: printf a wchar_t?

#2342
From: Doug Gwyn
Date: Tue, 29 Jan 1991 18:40
14 lines
1249 bytes
In article <2699@wn1.sci.kun.nl> lwj@cs.kun.nl (Luc Rooijakkers) writes:
>>Can you print a wchar_t using printf and some sort of % format?
>My interpretation of the standard says: no. While it would have been
>easy for the committee to include a %lc and a %ls format for printf, they
>have not done this.

That's because wchar_t is purely for internal program use, for example
in converting multibyte sequences to individual "character" units that
can be handled using traditional C programming methods, and it is
expected that the internal wchar_t representations would be mapped
back into multibyte sequences before being presented to the external
environment.  There are "shift state" reasons for not wanting to do
this at the individual wchar_t level, but rather on a 0-terminated
array of wchar_t.
Technical Details
Message-ID: <15012@smoke.brl.mil>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!samsung!think.com!paperboy!hsdndev!cmcl2!adm!smoke!gwyn
References: <1991Jan25.014927.24195@contact.uucp> <2699@wn1.sci.kun.nl>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!samsung!think.com!paperboy!hsdndev!cmcl2!adm!smoke!gwyn
From: gwyn@smoke.brl.mil (Doug Gwyn)
Newsgroups: comp.std.c
Subject: Re: printf a wchar_t?
Message-ID: <15012@smoke.brl.mil>
Date: 29 Jan 91 18:40:44 GMT
References: <1991Jan25.014927.24195@contact.uucp> <2699@wn1.sci.kun.nl>
Organization: U.S. Army Ballistic Research Laboratory, APG, MD.
Lines: 14