Author Topic: how to compile with unicode  (Read 7048 times)

Offline dv4-cb

  • Single posting newcomer
  • *
  • Posts: 5
how to compile with unicode
« on: July 28, 2013, 12:34:02 pm »
Im using code blocks 12.11 with visual studio 2010 compiler. My japanese characters are not displayed correctly. How can i enabl e unicode for my project? Cl.exe /nologo /w3 /0x /ndebug .....   i already tried adding /dunicode and /d_unicode.

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9723
Re: how to compile with unicode
« Reply #1 on: July 28, 2013, 01:38:21 pm »
What characters are not displayed correctly?
Do you mean the ones in the C::B editor, so within your source code?
Or do you mean the characters shown by your application after compilation at runtime?
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline dv4-cb

  • Single posting newcomer
  • *
  • Posts: 5
Re: how to compile with unicode
« Reply #2 on: July 28, 2013, 02:01:54 pm »
At runtime

Offline dv4-cb

  • Single posting newcomer
  • *
  • Posts: 5
Re: how to compile with unicode
« Reply #3 on: July 28, 2013, 02:06:29 pm »
I use messageboxw right at the start to test if unicode works. Right now its displaying the string in ansi. Looks somthing like this (a€aece)

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7785
    • My Best Post
Re: how to compile with unicode
« Reply #4 on: July 28, 2013, 04:21:16 pm »
At runtime

Turn on "Full compiler logging"
http://wiki.codeblocks.org/index.php?title=FAQ-Compiling_%28errors%29#Q:_How_do_I_troubleshoot_a_compiler_problem.3F
Do a re-build post the "build log" (Do NOT post the Build Messages) at a site that supports your Compiler or GUI Library; this site support neither.

From the Rules. http://forums.codeblocks.org/index.php/topic,9996.0.html

Quote
1. This is NOT a general programming board. "How do I write a program that....", "Can anybody teach me how to", "I have this homework", "My program doesn't run and I don't have the slightest idea of why because I'm a C++ newcomer", "What is a compiler", "What does gcc do" is the kind of questions that is FORBIDDEN to ask.

2. Compiler/Linker errors are NOT Code::Blocks errors. Usually, C++ newcomers tend to confuse the Editor/IDE (Code::Blocks) with the Compiler (MINGW / GCC). You may see some errors in the compiler output because you missed to do something right in your code. But that's not Code::Blocks troubleshooting, that's C++ troubleshooting and does not belong in here. If your program doesn't compile, READ THE C++ MANUAL.

3. Is your problem library, framework specific? There are appropriate forums for it, not the Code::Blocks forum.

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org