473,785 Members | 3,388 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

wcout, wprintf() only print English

Has anyone actually managed to print non-English text by using wcout or
wprintf and the rest of standard, wide character functions?
Feb 23 '08
44 4386
On 2008-02-24 10:51:32, James Kanze wrote:
>>>Also I have MS Visual C++ 2008 Express installed.
>>Under Linux ! :-)
>Linux::VMWare: :Windows::VC++2 008 Express.

Thanks. I'll give it a try myself. (Of course, the executables it
generates will also require VMWare to run, but it will allow at least
verifying that my code compiles with VC++ before trying to port it to
Windows.)
How will the generated executables require VMware to run? If you generate
executables in such an environment, they'll run on any of the Windows
platforms supported by your code and compilation, whether under VMware or
not.

Gerhard
Feb 25 '08 #41
On Feb 25, 2:08 pm, Gerhard Fiedler <geli...@gmail. comwrote:
On 2008-02-24 10:51:32, James Kanze wrote:
>>Also I have MS Visual C++ 2008 Express installed.
>Under Linux ! :-)
Linux::VMWare:: Windows::VC++20 08 Express.
Thanks. I'll give it a try myself. (Of course, the
executables it generates will also require VMWare to run,
but it will allow at least verifying that my code compiles
with VC++ before trying to port it to Windows.)
How will the generated executables require VMware to run?
How will they not? VC++ will certainly still produce a Windows
executable, not a Linux executable.
If you generate executables in such an environment, they'll
run on any of the Windows platforms supported by your code and
compilation, whether under VMware or not.
If I had a Windows platform handy, I'd run VC++ on it. If I
have to run it under VMware, it's because I don't have a Windows
platform available otherwise.

--
James Kanze (GABI Software) email:ja******* **@gmail.com
Conseils en informatique orientée objet/
Beratung in objektorientier ter Datenverarbeitu ng
9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34
Feb 26 '08 #42
On Feb 25, 1:22 pm, kasthurirangan. bal...@gmail.co m wrote:
On Feb 25, 4:53 pm, Ioannis Vranos <ivra...@nospam .no.spamfreemai l.gr>
wrote:
[...]
i am not sure how the conclusion was arrived - use
std::ios_base:: sync_with_stdio (false).
What does sync_with_stdio have to do with the locales? With the
exception of possible performance issues, and when buffers are
getting flushed (which is unspecified anyway), sync_with_stdio
should have no impact as long as all I/O actually is done with
iostream. If this is not the case, there's a problem with the
implementation.

--
James Kanze (GABI Software) email:ja******* **@gmail.com
Conseils en informatique orientée objet/
Beratung in objektorientier ter Datenverarbeitu ng
9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34
Feb 26 '08 #43
On 2008-02-26 05:59:44, James Kanze wrote:
>>(Of course, the executables it generates will also require VMWare to
run, but it will allow at least verifying that my code compiles with
VC++ before trying to port it to Windows.)
>How will the generated executables require VMware to run?

How will they not? VC++ will certainly still produce a Windows
executable, not a Linux executable.
Exactly. And that exe requires Windows, not VMware.
If I had a Windows platform handy, I'd run VC++ on it. If I
have to run it under VMware, it's because I don't have a Windows
platform available otherwise.
Right. But that's not a requirement of the generated executable. You can
install Windows in a dual-boot config or send the exe to someone else with
a Windows system or use a different virtualizer or Windows emulator, and
the exe will run just fine without VMware. It doesn't even know it was
compiled under VMware.

Gerhard
Feb 26 '08 #44
Hi!

Ioannis Vranos schrieb:
In summary, the locale specialisations work only either when we use the
locale::global( ) statement, or we use the
std::ios_base:: sync_with_stdio (false); statement. I have the feeling
this is a bug and not an implementation-defined behaviour.
You are using gcc on linux. With msvc8 on windows it seems to be the
other way round: When I set an utf8 converting locale on wcout only, it
works. However if I set it on wcout AND globally the output will be
garbled. Maybe it tries to do the conversion twice.

Note: I tested the utf8 output in an eclipse console which is set to
utf8 encoding.

From my current experience there is no usable wcout implementation that
reliably makes use of the conversion facet. Maybe I will just implement
a std wide (wchar_t) stream that outputs to a narrow stream and uses the
utf8 encoding. I could use that to simply wrap cout and replace wcout.

Frank
Jun 27 '08 #45

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

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.