From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=0.2 required=5.0 tests=BAYES_00,INVALID_MSGID, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,b0d68c502c0ae6 X-Google-Attributes: gid103376,public From: Hans Marqvardsen Subject: Re: Printing Enum Variable Re: Linux World Date: 1999/03/07 Message-ID: <36E267C2.4246@ddre.dk>#1/1 X-Deja-AN: 452523957 Content-Transfer-Encoding: 7bit References: <7bfc2n$jl9@dfw-ixnews5.ix.netcom.com> <7bhh26$r7c$1@remarQ.com> <36DCAC1F.430E2C5E@aasaa.ofe.org> <7bk5c2$8ge$1@remarQ.com> <36DDA9BA.E005E578@aasaa.ofe.org> <36DE3744.13F6A16A@omicron.se> <36DD54D2.141B@ddre.dk> <7bn19b$7h4$1@nnrp1.dejanews.com> <36DE58B5.49B@ddre.dk> <7bonjj$kgt$1@nnrp1.dejanews.com> Content-Type: text/plain; charset=us-ascii Organization: DDRE Mime-Version: 1.0 Reply-To: hm@ddre.dk_nospam Newsgroups: comp.lang.ada Date: 1999-03-07T00:00:00+00:00 List-Id: dewar@gnat.com wrote: > Note that for most purposes, it does not matter at all > what the external relationships are (you put characters > into your program, and they come out "right"). However, the programmer (and the maintainer of his program) must remember that they may get strange results, if they ever compare strings except for equality or if they ever use the otherwise nice classification functions of Ada.Characters.Handling, Is_Control, Is_Graphic, Is_Letter, Is_Lower, Is_Upper, or conversion functions: To_Lower, To_Upper, To_Basic. In conclusion: this is really a poor mans way of dealing with the full character set. > If the wrong > characters are coming out, talk to your OS vendor, not > your compiler vendor There are in fact these two approaches: a) Make the OS do the right thing b) Give your program a suitable interface to the OS at hand OF COURSE, in theory option a is preferable, but in practice this approach can be difficult. In Windows NT one can use the OS-supplied procedures SetConsoleCP and SetConsoleOutputCP to use the proper codepage. However one still has to select a non-default font, Lucida console, manually at execution. Under Windows 95, it just cant be done, IMHO. Option b may look more messy, but it works better IMHO. The desired interface, such as Console_Io, can be constructed from the OS-supplied procedures CharToOemA and OemToCharA. No need to select any non-default font. Works for W95 and NT alike. Hence in practice option b is preferable, maybe the only possible.