所用版本为doxygen1.8.0
注释中含有中文,生成的html显示为乱码。为解决该问题,查找了doxgen的帮助手册。
doxgen的配置中有一系列输入相关的选项(Input related options),其中有一选项为INPUT_ENCODING。doxgen手册中的描述为:
INPUT_ENCODING This tag can be used to specify the character encoding of the source files that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is also the default input encoding. Doxygen uses libiconv (or the iconv built into libc) for the transcoding. See the libiconv documentation for the list of possible encodings.
INPUT_ENCODING 用于指定doxygen要解析的源文件的字符编码方式。doxygen内部使用UTF-8编码,也是默认的输入编码。Doxygen用libiconv (or the iconv built into libc) 来进行编码转换。可以查询libiconv documentation中可能的编码列表。
我用的是GUI来设置doxygen的配置,即doxywizard。
打开doxywizard,Expert --> Input,会在左侧看到选项INPUT_ENCODING,将其设为:GB2312。设置好后,该选项会变成红色。
然后再重新运行,得到的html中的中文则不会再显示乱码了。