【fluent udf】UnicodeDecodeError: ‘gbk‘ codec can‘t decode byte 0x80 in position 670: illegal multibyt

一、问题背景

编译UDF的时候出现如下错误

UnicodeDecodeError: 'gbk' codec can't decode byte 0x80 in position 670: illegal multibyte sequence:
File "E:\BaiduSyncdisk\99_ansys_learn\230113_mould+piece\libudf\win64\3ddp_host\SConstruct", line 176:
generate_udf_source(t,s,env)
File "E:\BaiduSyncdisk\99_ansys_learn\230113_mould+piece\libudf\win64\3ddp_host\SConstruct", line 87:
for line in f:
(system "copy "D:\PROGRA~2\ANSYSI~1\v221\fluent"\fluent22.1.0\src\udf\sconstruct.udf "libudf\win64\3ddp_node\SConstruct" ")
????? 1 ???????
.............................(省略).............
UnicodeDecodeError: 'gbk' codec can't decode byte 0x80 in position 670: illegal multibyte sequence:
...........省略,错误跟上面一样

在这里插入图片描述

二、解决办法

将UDF代码文件另存为ANSI编码(中国区域就是GBK编码),然后再编译就不会出现编码错误了。

猜你喜欢

转载自blog.csdn.net/PSpiritV/article/details/129504264