Languages and Scripting
cancel
Showing results for 
Search instead for 
Did you mean: 

Support for tr_TR.iso88599 using wcstombs

 
Highlighted
Occasional Visitor

Support for tr_TR.iso88599 using wcstombs

I have a simple C program:

#include
#include
#include
#include

int main()
{
int nLen = 10;
int i = 0;
wchar_t *wcs = (wchar_t*)malloc(nLen*sizeof(wchar_t)+4);
char *dest;
int rc;
memset(wcs, '\0', nLen*sizeof(wchar_t)+4);
for (i=0; i {
wcs[i] = 0x0031;
}
wcs[1] = 0x0131;

setlocale(LC_ALL, "");
dest = (char*)malloc(nLen*2+1);
memset(dest, '\0', 2*nLen+1);
rc = wcstombs(dest, wcs, 2*nLen);

printf("--> rc: %d.\n", rc);
printf("--> output: %s.\n", dest);
}

When I set the locale in my environment to tr_TR.iso88599, the character \u0131 is not translated. If I used C.utf8, then it succeeds. \u0131 should be a valid code point in iso88599 (I-nodot).

Does anyone know the reason why?
Thank you very much.
1 REPLY 1
Highlighted

Re: Support for tr_TR.iso88599 using wcstombs

The character \u0131 is not the same as 0x0131.
For iso88599, i-nodot is 0xfd. In unicode it is 0x0131 as you have.

Tru64 has this nice web page:
http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/V51_HTML/MAN/MAN5/0035____.HTM

For HP-UX, you can look at:
/usr/lib/nls/loc/charmaps/iso88599.cm