Skip to content
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.Writer;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
Expand Down Expand Up @@ -91,6 +92,7 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.google.common.base.Charsets;
import com.google.common.collect.Multimap;
import com.google.common.collect.Sets;
import com.google.gson.Gson;
Expand Down Expand Up @@ -3198,7 +3200,7 @@ private static Properties readConfigFile() {

// load the properties
try {
properties.load(inputStream);
properties.load(new InputStreamReader(inputStream, Charsets.UTF_8));
inputStream.close();
} catch (FileNotFoundException fnf) {
LOG.info("No configuration file " + CONFIG_FILE + " found in classpath.", fnf);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1074,4 +1074,9 @@ public void testOverridingDhtKeySize() {
Assert.assertEquals(1024, new Configuration(properties).getTlsEphemeralDhKeySize());
}

@Test
public void canReadNonLatin1Properties() {
Assert.assertEquals("árvíztűrő tükörfúrógép", new Configuration().getProperty("encoding.test"));
}

}
4 changes: 3 additions & 1 deletion ambari-server/src/test/resources/ambari.properties
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,6 @@
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.

encoding.test=árvíztűrő tükörfúrógép