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

Update README.md #6

Merged
merged 1 commit into from
Jul 25, 2023
Merged

Conversation

faxi05
Copy link
Contributor

@faxi05 faxi05 commented Jul 25, 2023

Mention the getRawBody() getter in the README file.

We encountered an encoding issue with serialized JSON objects when fetching them via getBody(). Using getRawBody() instead fixed this for us, hence the proposal to add it to the README.

Mention the getRawBody() getter in the README file.

We encountered an encoding issue with serialized JSON objects when fetching them via getBody(). Using getRawBody() instead fixed this for us, hence the proposal to add it to the README.
@bdw429s bdw429s merged commit df48cd1 into Ortus-Solutions:development Jul 25, 2023
@bdw429s
Copy link
Collaborator

bdw429s commented Jul 25, 2023

@faxi05 Thanks for the update! What was the issue you encountered? Is it a bug we can address?

@faxi05
Copy link
Contributor Author

faxi05 commented Jul 25, 2023

@bdw429s I am posting a sample Rabbit message we are consuming below. You can see a few nice umlaut characters and even an emoji inside the various "comment" sections. The message is UTF-8 encoded. Using getBody() returns those chars garbled, while getRawBody() returns all chars correctly.

CFDocs mentions that "complex object types can only be used in combination with the member syntax" when using toString() under Lucee, maybe that's a pointer?

{"type":"secretary","competition":"bb9bec32-37a4-459a-bff1ec22cb9b48cc","testcode":"F1.a","phase":"PREL","heat":"NONE","role":"2","judge":"XX894","sta":35,"marks":[null,{"mark":"6.5","markType":"MARK","cards":"","flags":""},{"mark":"7.0","markType":"MARK","cards":"","flags":""},{"mark":"7.5","markType":"MARK","cards":"","flags":""},{"mark":"0.0","markType":"MARK","cards":"","flags":""},{"mark":"5.0","markType":"MARK","cards":"","flags":""}],"result":"5.4","comments":[null,{"comment":["gutes Tempo","zu schnell"],"language":"DE"},null,{"comment":["😃"]},{"comment":["Außengalopp"]},{"comment":["zu früh gelegt"]}],"adjust":""}

@bdw429s
Copy link
Collaborator

bdw429s commented Jul 25, 2023

Hmm, the only difference between body and raw body is passed through the toString() BIF and, if there is an _autoJSON header on the message, also passed through deserializeJSON().

I can't reproduce this however on trycf.com with those same BIFs.

https://trycf.com/gist/d7202d4922a2325405032af7a4cf1a22/lucee5?theme=monokai

Can you put in some debugging in models/Message.cfc and see where the data is getting lost?

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

Successfully merging this pull request may close these issues.

2 participants