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

XMI post success depends on system default charset #260

Open
MichelSc opened this issue Nov 19, 2022 · 1 comment
Open

XMI post success depends on system default charset #260

MichelSc opened this issue Nov 19, 2022 · 1 comment
Labels
bug Something isn't working modelserver EMF.cloud Model Server

Comments

@MichelSc
Copy link

I post an XMI to the modelserver.

If the system defaut charset is not UTF-8, we get the exception

ERROR org.eclipse.emfcloud.modelserver.emf.common.util.ContextResponse - An error occurred during data decoding
org.eclipse.emfcloud.modelserver.common.codecs.DecodingException: org.eclipse.emf.ecore.resource.Resource$IOWrappedException: Invalid byte 2 of 3-byte UTF-8 sequence.

Error is on this line:

result.load(new ByteArrayInputStream(payload.getBytes()), resourceSet.getLoadOptions());

The code encodes the payload string using the default system charset with String.getBytes: NOK.

Workaround: start the executable with -Dfile.encoding="UTF-8"

@MichelSc MichelSc added bug Something isn't working modelserver EMF.cloud Model Server labels Nov 19, 2022
@eneufeld
Copy link
Contributor

Thank you for raising this issue. We will take a look at this.
Of course we still happily accept a contribution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working modelserver EMF.cloud Model Server
Projects
None yet
Development

No branches or pull requests

2 participants