[Info-vax] C limitations, was: Re: VMS process communication
Arne Vajhøj
arne at vajhoej.dk
Thu Apr 27 20:13:13 EDT 2023
On 4/26/2023 6:19 PM, Johnny Billquist wrote:
> On 2023-04-23 01:59, Arne Vajhøj wrote:
>> On 4/22/2023 7:47 PM, Arne Vajhøj wrote:
>>> True. In C the isdigit function would be much better than a range check.
>>>
>>> Some other languages have similar functions, but not necessarily
>>> doing what the programmer want.
>>>
>>> Java has a Character.isDigit method that return true for 350 chars.
>>> But I am pretty sure that most Java developers are interested in
>>> knowing if the char is in 0..9 not whether it is among those 350 chars.
>>
>> Of course C also got iswdigit - which on my system return true
>> for 263 input values.
>>
>> But I don't think w is that popular in C.
>
> wide chars are such a mess. I won't even try to discuss them. :-)
> But I assume that the one i Java in the end is assuming you are dealing
> with Unicode, and I would suspect that for the C version as well. And
> Unicode is a mess.
Java got two isdigit - one that accept a char which contains
an UTF-16 code unit and one that accept an int which
contains an Unicode code point.
In general I am OK with Unicode - all those "thingies"
exist - it does not make any sense to pretend that
they do not exist, so they need to be handled.
Using UTF-16 in memory for char and string, UTF-8
on disk and on wire plus NCHAR/NVARCHAR/NCLOB in database
usually works fine for me.
(UTF-16 in memory does not work to well for anything outside
BMP, but in practice most stuff are in BMP)
But Unicode API's sometimes have a few things that bothers
me - one of them is isxxxxx methods that assume I want
to check for all languages.
Arne
More information about the Info-vax
mailing list