Skip to content

Conversation

@robholland
Copy link
Contributor

Fixes Encoding::UndefinedConversionError errors for some UTF characters.

Fixes Encoding::UndefinedConversionError errors for some UTF characters.
@antstorm
Copy link
Contributor

antstorm commented Mar 1, 2021

@robholland can you help me understand where this error comes from? Is it protobuf encoding complaining or GRCP? Or Temporal server?

@robholland
Copy link
Contributor Author

It's the transcoding attempt that the protobuf code makes to try and turn the serialised JSON string from us (which contains UTF-8 characters which are valid in JSON) into ASCII-8BIT to fit in the bytes-typed data field for Temporal Payloads. UTF characters with the high bit set are not transcodable into ASCII-8BIT as they have no ascii equivalent so the transcode fails. Calling .b on the serialised JSON string escapes any high-bit-set characters which allows the string to be transcoded to ASCI-8BIT safely, and then deserialised on the other side into the correct UTF-8 characters.

@robholland
Copy link
Contributor Author

Prior art here: protocolbuffers/protobuf#4228

Copy link
Contributor

@antstorm antstorm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@antstorm antstorm merged commit 01b46e8 into coinbase:master Mar 5, 2021
christopherb-stripe pushed a commit to christopherb-stripe/temporal-ruby that referenced this pull request Jan 19, 2022
…ner/woflo-482

Workflow await condition in context wait_for
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants