1. RE: National characters under Borland C++ 5.02 Windows/DOS
- Posted by rforno at tutopia.com Aug 04, 2002
- 494 views
I know that, Martin. The problem is that Borland C++ 5.02 automatically uses an editor that runs Windows style, and when executing the recently compiled program, it does it on a DOS Window. A solution would be to specify an ANSI code page for DOS, but this has two problems: 1) The current page is 850 (Multilingual), and is the one used by most files I have that were generated under DOS. So, if I change it for another one, my old files will get screwed up for viewing. 2) Even if I wished to change this 850 code page for the ANSI one, I don't know what its number is. Does somebody know it? If so, perhaps I could devise a solution to alternate between these code pages. All of this is not because I am actively using Borland C++ 5.02 nor even C++, but because I am teaching this at a local University, and the students have to use this compiler. ----- Original Message ----- From: Martin Stachon <martin.stachon at worldonline.cz> To: EUforum <EUforum at topica.com> Sent: Sunday, August 04, 2002 8:05 AM Subject: Re: National characters under Borland C++ 5.02 Windows/DOS DOS and Windows use different code pages. I guess your editor is for Windows, so it uses ANSI code page for Spanish, while DOS box uses OEM code page. You need to convert between this two. (Eg. EditPad has OEM<->ANSI function, also Windows API has some OEM<->ANSI functions) Also be sure to have DOS codepage selected correctly, using lines mode con codepage prepare=((852) C:\WINDOWS\COMMAND\ega.cpi) mode con codepage select=852 in autoexec.bat (you need to replace 852 with codepage number for Spanish) If none of this helps, ask Igor Martin ----- Original Message ----- From: <rforno at tutopia.com> To: "EUforum" <EUforum at topica.com> Sent: Sunday, August 04, 2002 7:19 AM Subject: National characters under Borland C++ 5.02 Windows/DOS Dear Euphorians: Of course this is an Off-topic question. I am having problems with Borland C++ 5.02 because, when you specify a character string in the editor, using national characters (in Spanish áéíóúüñ etc.), it uses the Windows standard for them. However, when you compile and execute such a program by means of the facilities that come with the compiler (for example, the "lightning" button), it executes the program under a DOS windows, and the national characters show as strange graphs. Does someone know a way to avoid this problem? TIA.
2. RE: National characters under Borland C++ 5.02 Windows/DOS
- Posted by rforno at tutopia.com Aug 04, 2002
- 432 views
Thanks, Igor, but the problem is how to use the standard facilities of Borland C++ 5.02 without too much fuss. Please see my answer to Martin Stachon. Regards. ----- Original Message ----- From: Igor Kachan <kinz at peterlink.ru> Subject: Re: National characters under Borland C++ 5.02 Windows/DOS Hello Ricardo, ---------- > Îò: rforno at tutopia.com > Êîìó: EUforum <EUforum at topica.com> > Òåìà: National characters under Borland C++ 5.02 Windows/DOS > Äàòà: 4 àâãóñòà 2002 ã. 9:19 > > Dear Euphorians: > Of course this is an Off-topic question. > I am having problems with Borland C++ 5.02 because, > when you specify a character string in the editor, > using national characters (in Spanish áéíóúüñ etc.), > it uses the Windows standard for them. However, when > you compile and execute such a program by means of > the facilities that come with the compiler > (for example, the "lightning" button), it executes > the program under a DOS windows, and the national > characters show as strange graphs. > Does someone know a way to avoid this problem? > TIA. This problem exists because of MS DOS and MS Windows have different code pages (CPs). If you are working on plain DOS, in the DOS window or on Windows console, these code pages are 8??, so Windows uses *the fonts* for these CPs, OEM encoding, terminal font. Your *strings* are *stable* but depend on editor you use. ed - DOS encoding, NotePad - Windows (ANSI) encoding, there are editors where you can switch fonts - Jfe and CodeGenie, for example. Use Terminal font in these editors and you'll have DOS encoding for strings. Or you can copy/paste strings from the NotePad's txt files into your program under ed. You'll see some strange characters in ed, but the *pure* Windows program will output the right strings. But on consoles - other thing. Compiler do nothing with you strings encoding. Just Windows changes the fonts. There is one exception with ex.exe interpreter. In the *text* modes it uses system DOS fonts, but in *graphics* modes it uses the inner hardly built in fonts. Try please (for more examples about DOS encodings) package: http://www.rapideuphoria.com/nuphor23.zip to get the light (compiled source) PD ex.exe with another built in fonts. That nuphor23.zip is Rob's and my co-work. The interpreters of nuphor23.zip allow any national or special characters (128..255) for identifiers in the Euphoria programs. Or try please my Polyglot package: http://www.rapideuphoria.com/polyglot.zip This program can to work with Chinese, Japanese and Korean now (with many other langs too ;). Regards, Igor Kachan kinz at peterlink.ru
3. RE: National characters under Borland C++ 5.02 Windows/DOS
- Posted by rforno at tutopia.com Aug 09, 2002
- 487 views
Thanks, Martin. I don't know why my answer did not reach you. Maybe Topica? Or perhaps my server (tutopia.com)? Well, the problem does not really affect me, because as you said, I can use my own translation program written in Euphoria. The problem affects my pupils at the University, because they have only access to this compiler, do not know many tricks, and so I'd prefer they use the standard facilities of the compiler. You know, there is no code-page for ANSI coding that works for DOS. Even if it were one, this would imply modifying DOS for other tasks. So, as a teacher, I'm at a loss. Thanks again. ----- Original Message ----- From: Martin Stachon <martin.stachon at worldonline.cz> Subject: Re: National characters under Borland C++ 5.02 Windows/DOS > > Ricardo Forno wrote: > > Thanks, Igor, but the problem is how to use the standard facilities of > > Borland C++ 5.02 without too much fuss. Please see my answer to Martin > > Stachon. > > I can't see any answer to my message...Topica?! > > I have never seen your Borland IDE, but maybe you can set up codepage for editing? > Or perhaps you can write a simple tool to run your code thru and change code page. > (Maybe you could also tell the IDE to do it automatically during build process) > btw you can use windows API function for this: > > /* Win->Dos */ > BOOL CharToOem( > > LPCTSTR lpszSrc, // pointer to string to translate > LPSTR lpszDst // pointer to translated string > ); > > > /* Dos->Win > BOOL OemToChar( > > LPCSTR lpszSrc, // pointer to string to translate > LPTSTR lpszDst // pointer to buffer for translated string > ); > > or you can just use your own table for conversion. > > Or perhaps you can write a macro in C to let the preprocessor do this > for you? I am not a skilled C programmer, but I don't know how to change > strings with macro. (But still possible in runtime) > > > >