tag: Io OS ar file SP on ad BS
// Chinese characters excluded
// # Include <iostream>
//
// Int main (){
//
// File * fp = fopen ("INI/language. ini", "rb ");
// If (FP = NULL ){
// STD: cout <"Open error" <STD: Endl;
// Return-1;
//}
//
// Char CH, chpre;
// Chpre = EOF;
// CH = fgetc (FP );
// STD: cout <"\ n \ nchar: \ n"; // <ch <STD: Endl;
// While (Ch! = EOF ){
// If (chpre! = EOF & chpre = '\ n' & Ch = ';'){
// While (Ch! = '\ N '){
// If (CH = EOF) return 0;
// CH = fgetc (FP );
//}
// CH = fgetc (FP );
// Continue;
//}
//
/// STD: cout <ch;
// Printf ("% C", CH);/* remove line breaks */
//
// Chpre = CH;
// CH = fgetc (FP );
//}
// STD: cout <"\ n ";
//
//
// Int result = fclose (FP );
// STD: cout <"fclose (FP):" <result <STD: Endl;
// STD: cout <"over" <STD: Endl;
// Getchar ();
// Return 0;
//}
// Contains Chinese Characters
# Include <stdio. h>
# Include <wchar. h>
Void main ()
{
File * FP;
Wchar_t ch [2560];
If (FP = fopen ("D: \ work \ 1011 \ temp \ language_utf8.ini", "R, CCS = UTF-8") = NULL)
{
Printf ("file cannot open! ");
Return;
}
// CH = fgetc (FP );
// Fread (& Ch, wcslen (& Ch) * sizeof (wchar_t), 2560, FP );
Fread (& Ch, 1 * sizeof (wchar_t), 2560, FP );
Fclose (FP );
Getchar ();
}
C read UTF-8 text files