Excuse me. When I use the generated by gennodejs, some problem make me embarrassed.
The generated getMessageSize function cannot get correct size of object which has string-type field when unicode string is used
e.g.
SetString.srv:
string data
---
bool success
string message
When I call the request "{ data: '这是参数' }" ( UTF-8 such as Chinese)
It cannot work, and an error like 'RangeError [ERR_OUT_OF_RANGE]: The value of "offset" is out of range' throwed
I read the getMessageSize function in SetString.js
It's like this:
And then, it works
Maybe the change I make is not suitable for all, but it worked for my problem.
So, I think the generate function must be improved to successfully work for unicode string type
Excuse me. When I use the generated by gennodejs, some problem make me embarrassed.
The generated getMessageSize function cannot get correct size of object which has string-type field when unicode string is used
e.g.
SetString.srv:
When I call the request "{ data: '这是参数' }" ( UTF-8 such as Chinese) It cannot work, and an error like 'RangeError [ERR_OUT_OF_RANGE]: The value of "offset" is out of range' throwed
I read the getMessageSize function in SetString.js It's like this:
But I don't think is correct, so I changed it to:
And then, it works Maybe the change I make is not suitable for all, but it worked for my problem. So, I think the generate function must be improved to successfully work for unicode string type
Do you think so?