Skip to content

Non-ASCII characters break RedactorX Page selector dropdown #5381

Open

Description

@blunket

Description of the problem
I discovered this bug while asking for help in a thread on the EE slack channel: https://eecms.slack.com/archives/C04L896K4/p1787758882895719

If any page entry contains a non-ASCII character (at least in the title field, not sure what other fields apply; the character was U+2028 "Line Separator" in my case), the page selector dropdown does not load in RedactorX (on any entry) when adding a link, and an error is thrown in the console:

Uncaught InvalidCharacterError: Failed to execute 'btoa' on 'Window': The string to be encoded contains characters outside of the Latin1 range.

How To Reproduce
Steps to reproduce the behavior:

  1. Create a Rich Text Editor field using RedactorX
  2. Configure Structure and create a page entry with a non-ASCII character in the title (e.g. 
)
  3. Save
  4. Try to add a link in Redactor; the page selector does not appear.

Possible Solution
This is related to the btoa function in Javascript.
The top answer here on StackOverflow suggests using TextEncoder to deal with this issue, which seemed to work for me in a brief test.

I do not currently have a development environment set up for contributing to EE but I would be happy to set one up and open a PR when I can get around to it if this is not handled before that time.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions