Skip to content

Default operation content encoding is unstable as it relies on the underlying OS's default #689

Closed
@pengliaoye

Description

@pengliaoye

class: AbstractOperationMessage

change

@Override
public String getContentAsString() {
	if (this.content.length > 0) {
		Charset charset = extractCharsetFromContentTypeHeader();
		return (charset != null) ? new String(this.content, charset) : new String(this.content);
	}
	return "";
}

to

@Override
public String getContentAsString() {
	if (this.content.length > 0) {
		Charset charset = extractCharsetFromContentTypeHeader();
		return (charset != null) ? new String(this.content, charset) : new String(this.content, "UTF-8");
	}
	return "";
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions