c语言输入字符进文件的时候为什么是乱码呢,请教各位大佬解惑

#include
#include
int main(void)
{
char ch;
FILE*fp;
char fli[20];
printf("一个文件名\n");
scanf("%s", &fli);
while (getchar() != '\n')
{ continue;
}
puts("输入一些字符到文件中");
if ((fp = fopen(fli, "w")) == NULL)
puts("无法打开文件");
else
{
while(ch = getchar() != '\n')

        fputc(ch,fp);
}

fclose(fp);
return 0;

}

这样的情况

https://blog.csdn.net/qq_35375147/article/details/79594654