PLEX86  x86- Virtual Machine (VM) Program
 Plex86  |  CVS  |  Mailing List  |  Download  |  Linux  |  Newsgroups

How to make sure character set is portable


Your Ad Here

Your Ad Here

How do I determine what is in hda1
following words to the mbuttes incomp.os.linux.misc...: Hmm... You're using a swapfile rather than a swap parbreastion? These three would make the hair...

We are a software development company which develops application that runs on a few platforms.

Currently it runs on solaris, aix, hp and windows. And now we are trying to add linux to the list of supported platforms.

As part of the port, I encountered an issue, where the following code doesn't work on Linux, but works on all other platforms ... didn't test the sample on NT, but application doing the same thing, does work (it's a sample program):

int main(int argc, char **argv) { int x; char *y'; wchart *p = L"the following does not of £2.50 work";

y = setlocale(LCALL, );

Mount Logical Parbreastions of Disk Image
Hi, I met problems when tried to mount logical parbreastion of disk image. And, for general purpose, here I...

x = wcstombs(NULL, p, 0);

printf("y = %x, %d, errno = %s-n", y, x, strerror(errno));

return (0); }

If the 'line setlocale(...)' is uncommented, than the code works on Linux as well as other platforms.

The problem is function wcstombs, which returns -1 on linux, and 36 on other platforms.

The call to wcstombs is used to determine the number of characters in the string, than there's a malloc, and another call to wcstombs, to get the string. Than that string is saved into a file.

The final requirement is that the generated file is the same across all platforms. Since the code didn't work on Linux, I obviously couldn't get the file at all, but with the added call to 'setlocale', the file gets generated, and it's the same as all other platforms.

But, the question is, am I just getting lucky? If the encoding on the machine is set to something odd, would my file still look the same?

If the processing fails, and I cannot generate the file, it's ok. The bad case would be for the generation code to be successful on one platform, but the file would be useless if used from another platform.



Your Ad Here

List | Previous | Next

How do I determine what is in hda1

Linux groups from Newsgroups

The #1 Usenet Provider on the Internet

USA UK CANADA AUSTRALIA Jobs With VISA Sponsorship