Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Content size exceeds specified content length.1091bytes written while expected 1086. #3

Closed
idootop opened this issue Jun 18, 2020 · 2 comments

Comments

@idootop
Copy link

idootop commented Jun 18, 2020

Snipaste_2020-06-18_15-12-12
当设置title为中文时会报错:Content size exceeds specified content length.
修复这个问题的方法是,在文件 \lib\src\soap\soap_action.dart 的第45行,把 headers.contentLength = content.length ,修·改为 headers.contentLength = utf8.encode(content).length,因为中文字符在 UTF-8 编码后的长度不等于原字符串长度。(1中文字符=2英文字符)


The error occurs when setting the title to Chinese: Content size exceeds specified content length.
The way to fix this problem is to add it to the file \lib\src\soap\soap_action. dart on line 45 and replace headers.contentLength = content.length , amend - to headers. contentLength = utf8.encode(content).length,because the length of Chinese characters after UTF-8 encoding is not equal to the length of the original string. (1 Chinese character = 2 English characters)

@idootop
Copy link
Author

idootop commented Jun 18, 2020

非常感谢你的这个项目,它帮了我很大忙,谢谢!


Thank you so much for this project, it has helped me so much, thank you!

@idootop idootop closed this as completed Jun 18, 2020
@succlz123
Copy link
Owner

lol, thank you for your suggestion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants