Re: A very puzzling problem: cout vs. wcout, fstream vs. wfstream
Francis Glassborow wrote:
In article <1149673212.669241.62590@j55g2000cwa.googlegroups.com>, kanze
<kanze@gabi-soft.fr> writes
The default locale, if you do nothing, is locale "C". This is also
the simplest locale, and usually doesn't support anything beyond
basic ASCII -- on my machine, isalpha( '?' ) returns false in locale
"C". This is rarely useful, although it is certainly the simplest,
safest and probably least surprising choice. It also works if your
code is only used in English speaking environments.
No, it doesn't, at least not in British English environments. As an
example the correct spelling of naive is na?ve [and to write that in
my newsreader I had to copy/paste it from elsewhere [or dug into the
documentation to discover how to type that direct from my keyboard].
That is just one example of a correct English word that cannot be
readily typed on a UK keyboard:-)
Well, it's certainly A correct spelling; I'm not sure it's the only
one.
(The online dictionary I use gives naive as the prefered spelling, with
na?ve as an alternative. But it's an American dictionary.) Ditto
cases
like encyclopedia (which started with an ae ligature when I was a kid).
And of course, even in an purely English speaking environment, you
might
want to output the name of some Czeck or Pole -- or a French wine. In
the case of the Czeck or the Pole, even ISO 8859-1 won't help.
(BTW: I have no trouble getting ? on the US keyboard on my Sparc. In
either vim or emacs. The same thing works under Linux or Windows:
although my Linux machine has a German keyboard and my Windows machine
a
French one, I normally install the US drivers and use them by default
--
there's no way I'm going to type C++ on a keyboard which doesn't have
{,
}, [, ], \ or | :-), even when the comments are in French.)
The symbols used for writing English words are substantially greater
in number than the 26 letters of the English alphabet + standard
punctuation symbols.
I believe that US English also sometimes uses extra symbols but I
think that it is always correct there to force spellings using only
the 26 letters of the alphabet.
Well, it's always correct, even in British English, in the same sense
that it is "correct" to omit accents on capital letters in French: the
rules are more or less officially bent to accomadate what is
technically
possible; for type written text, what a normal, mechanical typewriters
can support. In the case of French, at least, the bending is only a
tolerance, and only considered acceptable when conditionned by such
mechanical limitations.
It's also true that you can't generate anything acceptable for a
variable width font with just US ASCII. The use of single " character,
instead of different forms for opening and closing quotes, is also a
tolerance. More precisely stated, perhaps, straight ASCII works where
the only text IO is typewriter like text in English. You're correct in
pointing out that in general, our expectations have increased, and
except for simple things like log and configuration files, we generally
expect better quality output than that which can be simply achieved
with
just ASCII characters. Even in American English.
--
James Kanze GABI Software
Conseils en informatique orient?e objet/
Beratung in objektorientierter Datenverarbeitung
9 place S?mard, 78210 St.-Cyr-l'?cole, France, +33 (0)1 30 23 00 34
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]