Operating System - HP-UX
1837168 Members
3270 Online
110113 Solutions
New Discussion

Dynamically loaded locales

 
Mika Koljonen
New Member

Dynamically loaded locales

Hi,

How do I find out which shared objects (loacles) are loaded/used when I call e.g. isspace function in C my program.
I have a problem with scandinavian characters and isspace function.
I have two servers HP-UX ux04 B.10.20 A 9000/800 and HP-UX ux05 B.11.00 A 9000/800.
In ux04 isspace works fine but ux05 doesn't seem to undestand scandinavian characters. locale command in both servers give a same result.
$ locale
LANG=
LC_CTYPE="C"
LC_COLLATE="C"
LC_MONETARY="C"
LC_NUMERIC="C"
LC_TIME="C"
LC_MESSAGES="C"
LC_ALL=
$

Thanks!
3 REPLIES 3
Alex Glennie
Honored Contributor

Re: Dynamically loaded locales

fyi :

isspace is only supported for single-byte character code sets ...would Scandinavian locales/ langs fall outside of this ?

The implementation for the of range values
passed to isspace et al changed between 10.x and 11.0. As of 11.0 if values are out of range the return value may not be consistent.

Also note from the man page that only the integers -1 though 255 are supported by isspace
(except isascii the other functions mentioned on the same man page have the same
constraints). If you passes a number less than -1 or greater than 255 the results are undefined.... could this be relevant ?

You referred to problems/differences between 10.20 & 11.00 .... could you elaborate if the above does not help ?
Mika Koljonen
New Member

Re: Dynamically loaded locales

In 11.00 isspace function works fine if I first call setlocale(with LC_CTYPE and fi_FI.iso885915@euro)??? In 10.20 doesn't need to do that. I tested this behaviour in several servers.

Yes my characters (e.q. '?') are out of range.
If I change locales should isspace function works fine with e.q. '?'?

How it work in 10.20?
Mika Koljonen
New Member

Re: Dynamically loaded locales

I think problem occurs when I give to isspace function a char value greater than 127.

Here is my test program.

#include
#include
#include

main(int argc, char *argv[])
{
char mm = '?';

if (isspace(mm))
printf("'%c' (<%02X>) '%d' = true\n", mm, mm, mm);
else
printf("'%c' (<%02X>) '%d' = false\n", mm, mm, mm);
return 0;
}
when I execute this result is:
'?' () '-28' = true

if variable mm is unsigned char result is:
'?' () '228' = false

Would PHCO_19090 fix this problem?