Skip to content

W-17472621: Add a registry object to query the default encoding of the deployed app #1480

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

Merged
merged 2 commits into from
Jan 14, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions src/main/java/org/mule/runtime/api/config/ArtifactEncoding.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/*
* Copyright 2023 Salesforce, Inc. All rights reserved.
* The software in this package is published under the terms of the CPAL v1.0
* license, a copy of which has been included with this distribution in the
* LICENSE.txt file.
*/
package org.mule.runtime.api.config;

import org.mule.api.annotation.NoImplement;

import java.nio.charset.Charset;

/**
* Allows to query the encoding configured for the current deployable artifact.
*
* @since 4.10
*/
@NoImplement
public interface ArtifactEncoding {

/**
* @return the configured default encoding, checking in the following order until a value is found:
* <ul>
* <li>{@code configuration} of the artifact ->
* ({@code org.mule.runtime.core.api.config.MuleConfiguration.getDefaultEncoding()})</li>
* <li>The value of the system property {@code mule.encoding}</li>
* <li>{@link Charset#defaultCharset()}</li>
* </ul>
*/
Charset getDefaultEncoding();
}