| | |
c++ project for JAPANESE learning
Please support our C++ advertiser: Intel Parallel Studio Home
![]() |
Hi.I have been trying to write a simple program that teaches how to read and write Japanese.Unfortunately not every windows does not support Jpanese characters.So like when my program starts I have a pop up which has to give a japanese chared message altough I write the code as such on my computer when I use the message box gives me some odd chars....If there is a way in cpp to get over this problem please help me.....
C++ Syntax (Toggle Plain Text)
strcpy(Kanji[1][1], "ã?² ã?¨ ( ã?¤ )");
C++ Syntax (Toggle Plain Text)
MessageBox(hWnd, Kanji[1][1], "Kanji", MB_OK);
"By the data to date, there is only one animal in the Galaxy dangerous to man—man himself. So he must supply his own indispensable competition. He has no enemy to help him."
From Time Enough for Love by Robert A. Heinlein
From Time Enough for Love by Robert A. Heinlein
•
•
•
•
Originally Posted by johnroach1985
Hi.I have been trying to write a simple program that teaches how to read and write Japanese.Unfortunately not every windows does not support Jpanese characters.So like when my program starts I have a pop up which has to give a japanese chared message altough I write the code as suchon my computer when I useC++ Syntax (Toggle Plain Text)
strcpy(Kanji[1][1], "ã?² ã?¨ ( ã?¤ )");the message box gives me some odd chars....If there is a way in cpp to get over this problem please help me.....C++ Syntax (Toggle Plain Text)
MessageBox(hWnd, Kanji[1][1], "Kanji", MB_OK);
*Voted best profile in the world*
ouch drawing each of them....isn't there an easier way like creating a lib that uses the chars in that lib??
"By the data to date, there is only one animal in the Galaxy dangerous to man—man himself. So he must supply his own indispensable competition. He has no enemy to help him."
From Time Enough for Love by Robert A. Heinlein
From Time Enough for Love by Robert A. Heinlein
Okay try the following, but not sure if it will work. I got a similar problem since I am working on a Japanese OS.
Try this
The 'L' is not a mistake. Use it before the "" marks
Use
in your header files
Then should work.
I could not check it so no guarantees, anyway try it and tell me what you get.
PS. Kanji should be of type TCHAR.
e.g.
...
Try this
_tcscpy(Kanji[1][1], L"ã?² ã?¨ ( ã?¤ )" );Use
C++ Syntax (Toggle Plain Text)
#ifndef _UNICODE #define _UNICODE #endif
Then
C++ Syntax (Toggle Plain Text)
MessageBox(hWnd, Kanji[1][1], "Kanji", MB_OK);
I could not check it so no guarantees, anyway try it and tell me what you get.
PS. Kanji should be of type TCHAR.
e.g.
C++ Syntax (Toggle Plain Text)
TCHAR Kanji[ 2 ][ 3 ]
OKay here is a solution which I compiled and worked.
Use this in your main header file.
This worked at the Event where I wanted to display the message box.
Use this in your main header file.
C++ Syntax (Toggle Plain Text)
#include <windows.h> // Keep this above all the include files. #ifndef UNICODE #define UNICODE #endif #include <TCHAR.H>
This worked at the Event where I wanted to display the message box.
C++ Syntax (Toggle Plain Text)
TCHAR Kanji[ 10 ] = TEXT(""); _tcscpy(Kanji, TEXT("ã?² ã?¨ ( ã?¤ )")); MessageBox( hWnd, Kanji, TEXT("Kanji"), MB_OK);
•
•
•
•
Originally Posted by johnroach1985
Hi.I have been trying to write a simple program that teaches how to read and write Japanese.Unfortunately not every windows does not support Jpanese characters.So like when my program starts I have a pop up which has to give a japanese chared message altough I write the code as suchon my computer when I useC++ Syntax (Toggle Plain Text)
strcpy(Kanji[1][1], "ã?² ã?¨ ( ã?¤ )");the message box gives me some odd chars....If there is a way in cpp to get over this problem please help me.....C++ Syntax (Toggle Plain Text)
MessageBox(hWnd, Kanji[1][1], "Kanji", MB_OK);
Instead of using MessageBox(), you must use wide-char version of it, MessageBoxW(). Parametres are same for it, except for the title and text. Title and text must be in the WCHAR type.
And replace strcpy() with wcscpy() or StringCbCopyW().
Use L prefix.
"String" --> 8-bit chars
L"String" -> 16-bit chars
![]() |
Similar Threads
- final year project in software engineering!HELP! (Computer Science)
- help regarding mini project (Networking Hardware Configuration)
- Graduation Project : help please! (ASP)
Other Threads in the C++ Forum
- Previous Thread: Hamming codes encoder/decoder in C or C++
- Next Thread: substr() Causing Runtime Error
| Thread Tools | Search this Thread |
Tag cloud for C++
api application array arrays assignment beginner binary bitmap c++ c/c++ calculator char char* class classes code coding compile compiler console conversion convert count data database delete developer display dll email encryption error file forms fstream function functions game generator getline givemetehcodez graph homeworkhelper iamthwee ifstream image input int integer java lazy lib loop looping loops map math matrix memory multidimensional multiple newbie news node number output parameter pointer problem program programming project proxy python random read recursion recursive reference return sorting string strings struct template templates text tree url variable vector video visual visualstudio win32 windows winsock word wordfrequency wxwidgets






