Skip to content

XMI post success depends on system default charset #260

Description

@MichelSc

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"

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

    bugSomething isn't workingmodelserverEMF.cloud Model Server

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions