We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
If you click on "Try it..." you encounter an issue if the code has a non ASCII char:
From https://github.com/vlang/docs/blob/main/assets/scripts/v-docs.js#L340-L341
let code = editor.getValue(); let url = "https://play.vlang.io/?base64=" + btoa(code);
btoa can not encode Unicode chars.
btoa
The solution would need to be implemented on the vplay end as well to be able to decode the text ( https://developer.mozilla.org/en-US/docs/Web/API/Window/btoa#unicode_strings ):
function base64ToBytes(base64) { const binString = atob(base64); return Uint8Array.from(binString, (m) => m.codePointAt(0)); } function bytesToBase64(bytes) { const binString = Array.from(bytes, (byte) => String.fromCodePoint(byte), ).join(""); return btoa(binString); } // Usage bytesToBase64(new TextEncoder().encode("a Ā 𐀀 文 🦄")); // "YSDEgCDwkICAIOaWhyDwn6aE" new TextDecoder().decode(base64ToBytes("YSDEgCDwkICAIOaWhyDwn6aE")); // "a Ā 𐀀 文 🦄"
The text was updated successfully, but these errors were encountered:
No branches or pull requests
If you click on "Try it..." you encounter an issue if the code has a non ASCII char:

From https://github.com/vlang/docs/blob/main/assets/scripts/v-docs.js#L340-L341
btoa
can not encode Unicode chars.The solution would need to be implemented on the vplay end as well to be able to decode the text ( https://developer.mozilla.org/en-US/docs/Web/API/Window/btoa#unicode_strings ):
The text was updated successfully, but these errors were encountered: