D
DDD
Hi,
I have a question about character encode and file store format.
// xaM= is base64 codes of Chinese character '牛'
// The following codes will get a UTF-8 text file in
XP.
// And it will show a ţ .
char *decodedText = PL_Base64Decode("xaM=", 4,
nsnull);
FILE *fp1;
fp1=fopen("test.txt", "ab");
fwrite(decodedText, sizeof(char), strlen(decodedText), fp1);
fputc('\n', fp1);
fclose(fp1);
// uaTX98Wj is base64 codes of Chinese character "工作
牛"
// The following codes will get a ANSI text file in
XP.
// And it will show a "工作牛" .
char *decodedText1 = PL_Base64Decode("uaTX98Wj", 8, nsnull);
FILE *fp11;
fp11=fopen("test1.txt", "ab");
fwrite(decodedText1, sizeof(char), strlen(decodedText1), fp11);
fputc('\n', fp11);
fclose(fp11);
So, what will cause fwrite function to chose different file store
format, such as UTF-8 or ANSI in windows?
Thanks in advance.
I have a question about character encode and file store format.
// xaM= is base64 codes of Chinese character '牛'
// The following codes will get a UTF-8 text file in
XP.
// And it will show a ţ .
char *decodedText = PL_Base64Decode("xaM=", 4,
nsnull);
FILE *fp1;
fp1=fopen("test.txt", "ab");
fwrite(decodedText, sizeof(char), strlen(decodedText), fp1);
fputc('\n', fp1);
fclose(fp1);
// uaTX98Wj is base64 codes of Chinese character "工作
牛"
// The following codes will get a ANSI text file in
XP.
// And it will show a "工作牛" .
char *decodedText1 = PL_Base64Decode("uaTX98Wj", 8, nsnull);
FILE *fp11;
fp11=fopen("test1.txt", "ab");
fwrite(decodedText1, sizeof(char), strlen(decodedText1), fp11);
fputc('\n', fp11);
fclose(fp11);
So, what will cause fwrite function to chose different file store
format, such as UTF-8 or ANSI in windows?
Thanks in advance.