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

Inconsistent encoding handling with mlLoadModules across OSes #583

Closed
ahwitz opened this issue Apr 6, 2021 · 2 comments
Closed

Inconsistent encoding handling with mlLoadModules across OSes #583

ahwitz opened this issue Apr 6, 2021 · 2 comments

Comments

@ahwitz
Copy link

ahwitz commented Apr 6, 2021

Describe the bug
We've been trying to load the swagger-ui dist folder into a MODULES DB. Loading it when the Gradle agent is hosted on a Linux machine causes no issues, but running Gradle from a Windows machine causes encoding issues. We primarily develop with MarkLogic inside a Docker image on a Windows host, so we've confirmed that the same command (using the same Gradle code and the same ML installation) works on the Linux side but not the Windows side.

Also not sure if this is something that can be fixed in the first place, but figured we should report it.

To Reproduce
Steps to reproduce the behavior:

  1. Copy https://github.com/swagger-api/swagger-ui/blob/master/dist somewhere within an ml-modules directory that's exposable to an AppServer. (ours is at ml-modules/ext/swagger)
  2. Navigate to the file in your browser (for us, http://localhost:8011/ext/swagger/index.html)
  3. If done from Linux, file loads. If done from Windows, page should appear blank and two of the following errors appear in the console:

image

File has source content ^\x20-\x7EÀ-ž, but shows up in the database as ^\x20-\x7EÀ-ž when loaded from Windows.

Expected behavior
We want to be able to enforce an encoding on the files and have the same command load the same file the same way, regardless of OS. I remembered reading that ML only supports UTF-8, but if there's a way to force it to convert back from the Windows encoding back to UTF-8 so that the file will load, that'd be great. If this is resolvable as "It's a Windows problem", we totally understand.

@rjrudin
Copy link
Contributor

rjrudin commented Apr 6, 2021

Try what's in #155 for forcing Gradle to use UTF-8 - seems like a similar problem.

@ahwitz
Copy link
Author

ahwitz commented Apr 6, 2021

Least painful resolution to a Windows encoding error I've ever seen. Cheers!

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

No branches or pull requests

2 participants