Home > Back-end >  Merging Chinese TXT file
Merging Chinese TXT file

Time:10-13

C language in the merger of two Chinese TXT file, the second Chinese TXT file into a garbled, for bosses to help give directions

CodePudding user response:

You don't post code, nobody wants to talk at the picture

CodePudding user response:

Obvious coding is wrong, one is GBK, one is utf8

CodePudding user response:

Find a read binary tools, have a look,

CodePudding user response:

refer to the original poster Kalasapower response:
C language in the merger of two Chinese TXT file, the second Chinese TXT file into a garbled, for bosses to help give directions

# include "stdio.h"
# include "stdlib. H"
Int main ()
{
The FILE * fp1, * fp2;
char ch;
If ((fp1=fopen (" C: \ \ Users \ \ DELL \ \ Desktop \ \ 3. TXT ", "wt +"))!=NULL)
{
If ((fp2=fopen (" C: \ \ Users \ \ DELL \ \ Desktop \ \ 1. TXT ", "rt +"))!=NULL)
For (; (ch=fgetc (fp2))!=(EOF)
Fputc (ch, fp1);
The fclose (fp2);
If ((fp2=fopen (" C: \ \ Users \ \ DELL \ \ Desktop \ \ 2. TXT ", "rt +"))!=NULL)
for (int i=0; (ch=fgetc (fp2))!=EOF. I++)
Fputc (ch, fp1);
The fclose (fp2);
The fclose (fp1);
}
printf("\n");
system("pause");
return 0;
}

CodePudding user response:

reference 1st floor CHXCHXKKK response:
you don't post code, nobody wants to talk at the picture of

Ha ha, yesterday confused

CodePudding user response:

refer to the second floor gouyanfen response:
clear code is wrong, one is GBK, one is the utf8

Yes, is that the coding problem, could you tell me how to solve the

CodePudding user response:

refer to 6th floor Kalasapower response:
Quote: refer to the second floor gouyanfen response:
clear code is wrong, one is GBK, one is utf8

To to the rightness, that is, the coding problem, could you tell me how to solve the

Into a unified format to save back to look at the WideCharToMultiByte function
  • Related