布朗尼 UnicodeDecodeError: 'charmap'编解码器无法解码位置 2127 中的字节 0x9d:字符映射到<未定义>未定义>
我尝试使用布朗尼编译我的合同,并收到以下错误:
File "C:\Users\muvis\AppData\Local\Programs\Python\Python310\lib\encodings\cp1252.py",第 23 行,解码 返回 codecs.charmap_decode(input,self.errors,decoding_table)[0] UnicodeDecodeError:“charmap”编解码器无法解码位置 2127 中的字节 0x9d:字符映射到
我想编译此合同:
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/access/Ownable.sol";
contract compileError {
string[13] unicodeValues = [
" ",
"█",
"♥",
"¬",
"˘",
"^",
"X",
"◔",
"◕",
"✿",
"ಥ",
"◉",
"⚆" //" ", "█","♥","¬","˘","^","X","◔","◕","✿","ಥ","◉","⚆"
//could think about adding flowers ❀ ->❀ but we have already flowers
];
}
I tried to compile my contract using brownie and got the following error:
File "C:\Users\muvis\AppData\Local\Programs\Python\Python310\lib\encodings\cp1252.py", line 23, in decode
return codecs.charmap_decode(input,self.errors,decoding_table)[0]
UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 2127: character maps to
I wanted to compile this contract:
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/access/Ownable.sol";
contract compileError {
string[13] unicodeValues = [
" ",
"█",
"♥",
"¬",
"˘",
"^",
"X",
"◔",
"◕",
"✿",
"ಥ",
"◉",
"⚆" //" ", "█","♥","¬","˘","^","X","◔","◕","✿","ಥ","◉","⚆"
//could think about adding flowers ❀ ->❀ but we have already flowers
];
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我找到了问题的答案(无法想象这个......):
即使 ascii 值在注释中,它也无法编译。如果我删除注释,那么代码看起来像这样:
它编译时没有任何错误。希望这对遇到同样问题的人有帮助
I found the answer for the problem (couldnt imagine this...):
even if the ascii values are in the comment it cant compile. If I remove the comments, so the code looks like this:
it compiles without any errors. Hope this is helpful for anyone with the same problem