Skip to content

Re-enable handling of unicode strings in std.base64#492

Merged
stephenamar-db merged 1 commit intomasterfrom
stephenamar-db/b64fix
Aug 29, 2025
Merged

Re-enable handling of unicode strings in std.base64#492
stephenamar-db merged 1 commit intomasterfrom
stephenamar-db/b64fix

Conversation

@stephenamar-db
Copy link
Copy Markdown
Collaborator

@stephenamar-db stephenamar-db commented Aug 29, 2025

This is an artificial limitation in go-jsonnet and we are not bound by it.
We are perfectly capable of encoding and decoding unicode strings.

@stephenamar-db stephenamar-db merged commit ea2418c into master Aug 29, 2025
6 checks passed
@stephenamar-db stephenamar-db deleted the stephenamar-db/b64fix branch August 29, 2025 17:17
stephenamar-db added a commit that referenced this pull request Aug 29, 2025
This is an artificial limitation in go-jsonnet and we are not bound by
it.
We are perfectly capable of encoding and decoding unicode strings.
stephenamar-db added a commit that referenced this pull request Aug 29, 2025
This is an artificial limitation in go-jsonnet and we are not bound by
it.
We are perfectly capable of encoding and decoding unicode strings.
Base64.getEncoder.encodeToString(value.getBytes("UTF-8"))
case arr: Val.Arr =>
val byteArr = new Array[Byte](arr.length)
for (i <- 0 until arr.length) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

use a while loop instead

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I want the index though, for better error message.
Why would a while loop work better?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants