tags:

views:

199

answers:

4

Hi,

I am developing a test software where the user can enter a string where I must validate it as C++ variable syntax. Then I started wondering if people can develop in japanese or other idioms.

When I typed "is" on some IDE, it poped up a list with a "isascii" function. Then I wondered if I can use that function to check for the letters of the variable.

I googled and couldn't find about isascii if not on microsoft's msdn, so I guess its a windows function that use the locale of the machine?

could someone also explain a bit of this isascii and __isascii please?

edit: what of this "is" functions should I use to check for the letter that is in the name of the variable?

Thanks and sorry my nooberish!
Joe

+1  A: 

ILE C/C++ Run-Time Library Functions

jball
ty for the link, I guess its a standard then, those "is" functions?
Jonathan
It's part of the ANSI standards, and a description can be found in any complete c/c++ documentation; for example Microsoft describes it here: http://msdn.microsoft.com/en-us/library/5wcd48xw(VS.80).aspx
jball
Sorry, meant ISO standard.
jball
+3  A: 

I think you might find this article by Joel Spolsky helpful, if you're interested in writing software that can deal gracefully with international languages and character sets:

The Absolute Minimum Every Software Developer Absolutely, Positively Must Know About Unicode and Character Sets (No Excuses!)

Edit: Upon closer reading of your question, it seems you are more interested in whether international characters are valid to use in your C or C++ source code.
Yes, this is possible.

Jim Lewis
A: 

You can find out about character classification, including isascii, by looking at the man page. Which characters are considered letters (and so on) is determined by your "locale". I confess I always find locale settings confusing...

Norman Ramsey
A: 

The C standard doesn't consider letters that are not contained in ASCII as letters. Thus I don't think C supports characters other than [c=='_' isalpha()][c=='_' isalnum()]* for symbol names, even though other programming languages do. So you should check for that.

jbcreix