小编use*_*073的帖子

Python3 utf-8 解码问题

以下代码在我的 Windows 机器上使用 Python3 运行良好,并打印字符“é”:

data = b"\xc3\xa9"

print(data.decode('utf-8'))
Run Code Online (Sandbox Code Playgroud)

但是,在基于 Ubuntu 的 docker 容器上运行相同的结果:

UnicodeEncodeError: 'ascii' codec can't encode character '\xe9' in position 0: ordinal not in range(128)
Run Code Online (Sandbox Code Playgroud)

是否需要安装任何东西才能启用 utf-8 解码?

python linux windows utf-8 python-3.x

4
推荐指数
1
解决办法
5691
查看次数

函数必须只有一个参数

我已经很长时间没有用C ++编写代码了,我正在尝试修复一些旧代码。

我收到错误消息:

TOutputFile& TOutputFile::operator<<(TOutputFile&, T)' must have exactly one argument
Run Code Online (Sandbox Code Playgroud)

在以下代码上:

TOutputFile& TOutputFile::operator<<(TOutputFile&, T)' must have exactly one argument
Run Code Online (Sandbox Code Playgroud)

该运算符重载有什么问题?

c++ function

2
推荐指数
1
解决办法
176
查看次数

标签 统计

c++ ×1

function ×1

linux ×1

python ×1

python-3.x ×1

utf-8 ×1

windows ×1