| | |
non-latin character support in C++/C/Java etc
Please support our Computer Science advertiser: Learn about neural networks and artificial intelligence.
![]() |
•
•
Join Date: Jul 2008
Posts: 1
Reputation:
Solved Threads: 0
Hey everyone.
In a nutshell this is what I want to do.
I want to:
- Allow developers to write code in C++ using non-latin based languages. i.e > use #define (or whatever) to specify a non-latin based character as a keyword/variable.
e.g >
Instead of (English):
if(x < 1){
"Hello"
}
I want to be able to (Korean, won't display if you don't have support for asian languages) :
만약(ㅂ < 1){
"안녕"
}
Now I tried using #define but obviously the compiler (gcc) didn't like the non-latin characters.
Anyone got any idea how to enable support in GCC or where is the actual problem ?
In a nutshell this is what I want to do.
I want to:
- Allow developers to write code in C++ using non-latin based languages. i.e > use #define (or whatever) to specify a non-latin based character as a keyword/variable.
e.g >
Instead of (English):
if(x < 1){
"Hello"
}
I want to be able to (Korean, won't display if you don't have support for asian languages) :
만약(ㅂ < 1){
"안녕"
}
Now I tried using #define but obviously the compiler (gcc) didn't like the non-latin characters.
Anyone got any idea how to enable support in GCC or where is the actual problem ?
Last edited by caismirt; Jul 22nd, 2008 at 3:25 am.
>Anyone got any idea how to enable support in GCC or where is the actual problem ?
What you want (to a point) is some kind of extended character set for your compiler. Unicode is widely supported by compilers these days, so for example you can already change "Hello" to "안녕" and x to ㅂ if your compiler supports Unicode.
What you can't do is replace if with 만약 because that changes the code points, and thus, the meaning of the keyword. Regardless of the native language you want to program in, the English keywords of C++ will remain English unless you write some kind of preprocessor to convert your native language translations of the keywords to valid C++.
What you want (to a point) is some kind of extended character set for your compiler. Unicode is widely supported by compilers these days, so for example you can already change "Hello" to "안녕" and x to ㅂ if your compiler supports Unicode.
What you can't do is replace if with 만약 because that changes the code points, and thus, the meaning of the keyword. Regardless of the native language you want to program in, the English keywords of C++ will remain English unless you write some kind of preprocessor to convert your native language translations of the keywords to valid C++.
I'm here to prove you wrong.
![]() |
Other Threads in the Computer Science Forum
- Previous Thread: difference between main mem and auxiliary mem?
- Next Thread: Math Forum
| Thread Tools | Search this Thread |
ai algorithm algorithms amazon assignment assignmenthelp automata battery binary bittorrent bizarre bletchleypark blogging bomb business cern codebreaker compiler computer computers computerscience computertrackingsoftware connect conversion csc dataanalysis dataintepretation development dfa dissertation dissertations dissertationthesis dissertationtopic ebook employment energy extensions floatingpoint foreclosure foreclosuresoftware fuel gadgets geeks givemetehcodez government graphics hardware history homeowners homeworkassignment humor ibm idea ideas internet iphone ipod itcontracts jobs kindle laser laws linkbait lsmeans marketing mining mobileapplication msaccess nano netbeans networking news os piracy piratebay principles programming rasterizer research sam-being-cute sas science security sex spying sql stephenfry study supercomputer supercomputing sweden technology textfield turing turingtest two'scompliment uk virus warehouse ww2






