Hello there,
Here in Belgium we use land code 850 and an Azerty keyboard. When using a console program written in C++ (Visual Studio 6.0), we get the wrong output:
----------------------------------------------------
#include
using namespace std;
int main(){
cout
#include
#include
using namespace std;
//Override operator<< of ostream
ostream& operator<<(ostream & os, char* szSource) {
TCHAR szDestination[260] = "";
CharToOem(szSource, szDestination);
printf(szDestination);
return os;
}
int main() {
cout << "hélène\n";
return 0;
}
// output: hélène
----------------------------------------------------
Of course, this is not a perfect solution. For instance, if the string to be printed is longer than 260 characters, the program fails.
There must be a setting somewhere in the register that fixes this problem for once and for all, I guess. So that the first program always works in our country. Is there somebody with a better solution than ours? Thank you.
| Operating System : XP Pro SP1
CPU/Processor : AMD Athlon 1400 MHz
RAM : Actual:256 MB
Hard Disk : , Space: 120 GB
|