Skip to content

Disable Open in Remix button if contract has Unicode characters #545

@ericglau

Description

@ericglau

When using unicode characters (for example in a token name), Open in Remix doesn't work and causes a console error:

Uncaught (in promise) InvalidCharacterError: Failed to execute 'btoa' on 'Window': The string to be encoded contains characters outside of the Latin1 range.
    at remix.ts:3:34
    at Blob.type (App.svelte:197:17)

We currently encode ASCII to base64, because Remix takes a base64 encoded string and decodes it to ASCII.

If we convert a Unicode string to UTF-8 before encoding to base64, Remix would not decode it correctly as UTF-8.

Therefore, for now if Unicode characters are present in the contract, we should disable the Open in Remix button and give an appropriate message when hovering over it, something like "Open in Remix is not supported with Unicode characters"

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions