将文件类型从“ UTF-8 Unicode文本”转换为“ C源,ISO-8859文本”

时间:2019-12-07 03:42:28

标签: linux windows utf-8 touch iso-8859-15

我是一名程序员。我在Linux using GCC中编写了C代码,它们可以正常运行。现在,我想使用Visual studio 2015在Windows系统中运行这些代码。但是它总是显示一些错误和警告,如下所示:

1>f:\md\test_sm3_hmac_02\tools.h : warning C4819: The file contains a character that cannot be represented in the current code page (936). Save the file in Unicode format to prevent data loss
1>f:\md\test_sm3_hmac_02\types.h : warning C4819: The file contains a character that cannot be represented in the current code page (936). Save the file in Unicode format to prevent data loss
1>f:\md\test_sm3_hmac_02\tools.h(13): error C2143: syntax error: missing ')' before '*'
1>f:\md\test_sm3_hmac_02\tools.h(13): error C2143: syntax error: missing '{' before '*'

当我打开每个文件并将其复制到Windows中创建的新文件中时,不做任何其他更改。它可以正常运行。但是我的项目包含许多文件,因此我不这样做来解决此问题。 我想通过做一些工作来解决它。

VS2015在Windows中创建的文件格式为:

$ file testtypes.h
testtypes.h: C source, ISO-8859 text

在Linux中通过touch创建的文件格式为:

$ file filetest.c
filetest.c: UTF-8 Unicode text

我该怎么办?

0 个答案:

没有答案