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

byte[]在传值时自动转成string,导致部分数据异常,lua-protobuf解析时异常。 #1148

Open
yang1339 opened this issue Jun 29, 2024 · 1 comment

Comments

@yang1339
Copy link

在lua-protobuf解析时,大部分消息是没问题的,少量消息,尤其是带有中文时,经常出现问题
会报错:un-finished bytes (len 42 at offset 21),有些人遇到解决了,但是方案都不是很明确
哪位大佬能给个解决方案吗?

就算用base64处理后在lua中解出来,但是只要在lua里面传值,还是会转成string,并没有解决问题

有哪位大佬解决过这个问题~

@chexiongsheng
Copy link
Collaborator

chexiongsheng commented Jul 1, 2024

byte[]自动转lua string不会导致你说的问题。lua的string就是一段buffer+一个长度,恰好和byte[]一模一样,能完整承载所有信息。

你说的问题可能是你用的lua-protobuf没处理好(中文),去lua-protobuf那确认有没有这样的问题,怎么修复。

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