Skip to content
New issue

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

[Bug]: XMLHttpRequest invalid UTF-16 response from lib:// #3235

Closed
perkinslr opened this issue Dec 2, 2021 · 1 comment
Closed

[Bug]: XMLHttpRequest invalid UTF-16 response from lib:// #3235

perkinslr opened this issue Dec 2, 2021 · 1 comment
Labels

Comments

@perkinslr
Copy link
Contributor

Describe the Bug

The new XMLHttpRequest implementation improperly decodes lib:// responses as UTF-16, which produces gibberish output.

To Reproduce

In a frame5, execute this script, with any text data in the target URI

    const x = new XMLHttpRequest()
    x.open("GET", "lib://Test/macro/test.json")
    x.onreadystatechange = () => {
        console.log(x.readyState)
        if (x.readyState == 4) {
            console.log("XMLHTTPRequest Response:" + x.response)
        }
    }
    x.send()

Expected Behaviour

The content of test.json@lib:Test should be broadcast to the chat box.
Instead, a string of gibberish text is broadcast.
XMLHTTPRequest Response:笢景漢㨠㌲�

Screenshots

No response

MapTool Info

develop branch from github

Desktop

Gentoo Linux

Additional Context

No response

@Phergus
Copy link
Contributor

Phergus commented Dec 4, 2021

Assumed to be working.

@Phergus Phergus closed this as completed Dec 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants