fwprintf doesn't
fwprintf doesn't
- Subject: fwprintf doesn't
- From: Jean-Denis Muys <email@hidden>
- Date: Mon, 15 Oct 2012 22:49:54 +0200
Hi,
Perhaps this is a bit off-topic: I have a problem with the standard C library fwprintf() function.
In short, it behaves as fprintf(), not as it should: the output is filled with "narrow" chars, not "wide" wchar_t. Here is a very short program to illustrate:
#include <stdio.h>
#include <wchar.h>
int main()
{
const char *testFileName = "/Users/jdmuys/wideTestFile.txt";
FILE *wideTestFile;
wideTestFile = fopen(testFileName, "w");
fwide(wideTestFile, 1); // with or without this line, no difference.
fwprintf(wideTestFile, L"1234");
fclose(wideTestFile);
}
After that, hex dumping the wideTestFile.txt file shows that it contains the 4 bytes "31 32 33 34", which are the ascii code points for "1234". Nothing wide here.
Search on the web, I saw this article: http://publib.boulder.ibm.com/infocenter/iseries/v7r1m0/index.jsp?topic=/rtref/fwprintf.htm
I could not manage to replicate the outcome of their "Unicode" example, whatever my tweakings (especially regarding the locale).
I suppose I missed something, but what?
Thanks for any suggestion.
Jean-Denis
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden