By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,189 Members | 921 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,189 IT Pros & Developers. It's quick & easy.

Q: Locale independant way to process special chars

P: n/a
Hi,

Did not really know a short subject line, which describes my question
better. I want to figure out, if a specific character is an alphabetic
character, without having to be locale specific. For example, even tho the
Umlaut a (ie. '') is not in part of the English alphabet, it is part of the
German alphabet. Despite that, I would like the Umlaut a to be recognised as
an alphabetic character, without having to switch locales; otherwise, I
would have to loop thru all different locales, just to find out, if a
character is part of the alphabet of any of these.

Tho my documentation tells me that 'for iswalpha, the result of the test
condition is independent of locale', it still returns 0 for the Umlaut a. Is
my C++ implementation broken or did I just misunderstand something?

Thanks!
--
jb

(reply address in rot13, unscramble first)
Jul 22 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
"Jakob Bieling" <ar****************@rot13.com> wrote in message
news:cg*************@news.t-online.com...
Hi,

Did not really know a short subject line, which describes my question
better. I want to figure out, if a specific character is an alphabetic
character, without having to be locale specific. For example, even tho the
Umlaut a (ie. '') is not in part of the English alphabet, it is part of the German alphabet. Despite that, I would like the Umlaut a to be recognised as an alphabetic character, without having to switch locales; otherwise, I
would have to loop thru all different locales, just to find out, if a
character is part of the alphabet of any of these.
I would be surprised if there were a single standard function call that did
what you need to do. It sounds like an odd bit of functionality that most
people would never use. Why would you want to know if a character is an
alpabetic character in any locale? Is a loop not feasible?
Tho my documentation tells me that 'for iswalpha, the result of the test condition is independent of locale', it still returns 0 for the Umlaut a. Is my C++ implementation broken or did I just misunderstand something?


I would assume that this means that, for any input, the return value of
iswalpha will not change when the current locale changes.

--
David Hilsee
Jul 22 '05 #2

P: n/a
"Jakob Bieling" <ar****************@rot13.com> wrote in message
news:cg*************@news.t-online.com...
<snip>
Tho my documentation tells me that 'for iswalpha, the result of the test condition is independent of locale', it still returns 0 for the Umlaut a. Is my C++ implementation broken or did I just misunderstand something?


FWIW, std::iswalpha(L'') returned true on VS.NET 2003 Win2K Pro.

--
David Hilsee
Jul 22 '05 #3

P: n/a
"David Hilsee" <da*************@yahoo.com> wrote in message
news:7O********************@comcast.com...
"Jakob Bieling" <ar****************@rot13.com> wrote in message
news:cg*************@news.t-online.com...
<snip>
Tho my documentation tells me that 'for iswalpha, the result of the test
condition is independent of locale', it still returns 0 for the Umlaut

a. Is
my C++ implementation broken or did I just misunderstand something?


FWIW, std::iswalpha(L'') returned true on VS.NET 2003 Win2K Pro.

Ah, thanks for the hint. My fault, I passed a char without converting to
unsigned first, so the sign was expanded in the implicit conversion, which
made it return 0. It all works now, thanks! :)
--
jb

(reply address in rot13, unscramble first)
Jul 22 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.