-
Notifications
You must be signed in to change notification settings - Fork 528
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
string padding: incorrect length. #646
Comments
Fixed now. Thanks. |
thanks. |
Just one other suggestion on this topic...it might make sense in the getXXXAsString methods that are created to return a string WITHOUT the whitespace...
|
Done with this commit. 88a6f79 |
There are use cases already where fixed length arrays are used that are not strings, but are raw data. And a string is used. I think since this is a fixed length array, it should be the size it is. Let the caller decide whether or not to trim, etc. |
Now it is consistent with how the Java implementation has been for some time. With a string it does not feel right to have unprintable characters. |
It is a fairly common practice to store raw data in a |
It is a tricky one. For supported customers we should do the right thing. From a design symmetry perspective I believe that if it null pads for short strings on encode then it should give a trimmed string on decode. Knowing that people we don't directly support do crazy things feels like the wrong reason to allow an asymmetry. If raw data then it should be an array of unit8. Maybe I'm just too picky. |
Great, thanks for the fix. its an interesting discussion you are having.
I tend to agree with the the comment "I believe that if it null pads for
short strings on encode then it should give a trimmed string on decode".
Otherwise its a little confusing with the function naming getXXAsString().
Anything, thanks for the fix!
…On Mon, Mar 4, 2019 at 5:15 AM Martin Thompson ***@***.***> wrote:
It is a tricky one. For supported customers we should do the right thing.
From a design symmetry perspective I believe that if it null pads for short
strings on encode then it should give a trimmed string on decode. Knowing
that people we don't directly support do crazy things feels like the wrong
reason to allow an asymmetry. If raw data then it should be an array of
unit8. Maybe I'm just too picky.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#646 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/Ai60NImr7ZBjW53OjGeyZ87kaLa8gg37ks5vTC1NgaJpZM4bPoh3>
.
|
Hi,
The following method is copying a string to a SBE message buffer but the padding is not working for a string length less than 20. The loop that adds the padding (this part: start < length) needs to use the buffer size not the srcLength, no?
The text was updated successfully, but these errors were encountered: