•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the Computer Science and Software Design section within the Software Development category of DaniWeb, a massive community of 391,682 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,188 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Computer Science and Software Design advertiser:
Views: 256 | Replies: 1
![]() |
•
•
Join Date: Jul 2008
Posts: 1
Reputation:
Rep Power: 0
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 : 29 Days Ago at 2: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++.
Member of: Beautiful Code Club.
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
•
•
•
•
DaniWeb Computer Science and Software Design Marketplace
•
•
•
•
- Previous Thread: difference between main mem and auxiliary mem?
- Next Thread: Math Forum



Linear Mode