From daf0b081e7ace426fb4a421c4cff739142012267 Mon Sep 17 00:00:00 2001 From: Stephane Nicoll Date: Fri, 6 May 2016 11:03:56 +0200 Subject: [PATCH] Revert "Add support for UTF-8 in application.properties" This reverts commit d6a424f94c4ed43dfee8b77f380de2529a256843. Closes gh-5361 # Conflicts: # spring-boot/src/test/resources/org/springframework/boot/env/test-encoded.properties --- .../boot/env/PropertiesPropertySourceLoader.java | 4 +--- .../boot/env/PropertiesPropertySourceLoaderTests.java | 7 ------- .../org/springframework/boot/env/test-encoded.properties | 1 - 3 files changed, 1 insertion(+), 11 deletions(-) delete mode 100644 spring-boot/src/test/resources/org/springframework/boot/env/test-encoded.properties diff --git a/spring-boot/src/main/java/org/springframework/boot/env/PropertiesPropertySourceLoader.java b/spring-boot/src/main/java/org/springframework/boot/env/PropertiesPropertySourceLoader.java index d09e630aea8..7f3eb266681 100644 --- a/spring-boot/src/main/java/org/springframework/boot/env/PropertiesPropertySourceLoader.java +++ b/spring-boot/src/main/java/org/springframework/boot/env/PropertiesPropertySourceLoader.java @@ -22,7 +22,6 @@ import java.util.Properties; import org.springframework.core.env.PropertiesPropertySource; import org.springframework.core.env.PropertySource; import org.springframework.core.io.Resource; -import org.springframework.core.io.support.EncodedResource; import org.springframework.core.io.support.PropertiesLoaderUtils; /** @@ -42,8 +41,7 @@ public class PropertiesPropertySourceLoader implements PropertySourceLoader { public PropertySource load(String name, Resource resource, String profile) throws IOException { if (profile == null) { - Properties properties = PropertiesLoaderUtils - .loadProperties(new EncodedResource(resource, "UTF-8")); + Properties properties = PropertiesLoaderUtils.loadProperties(resource); if (!properties.isEmpty()) { return new PropertiesPropertySource(name, properties); } diff --git a/spring-boot/src/test/java/org/springframework/boot/env/PropertiesPropertySourceLoaderTests.java b/spring-boot/src/test/java/org/springframework/boot/env/PropertiesPropertySourceLoaderTests.java index 6f719dfd512..f5e08c24bf8 100644 --- a/spring-boot/src/test/java/org/springframework/boot/env/PropertiesPropertySourceLoaderTests.java +++ b/spring-boot/src/test/java/org/springframework/boot/env/PropertiesPropertySourceLoaderTests.java @@ -46,13 +46,6 @@ public class PropertiesPropertySourceLoaderTests { assertThat(source.getProperty("test"), equalTo((Object) "properties")); } - @Test - public void loadPropertiesEncoded() throws Exception { - PropertySource source = this.loader.load("encoded.properties", - new ClassPathResource("test-encoded.properties", getClass()), null); - assertThat(source.getProperty("test"), equalTo((Object) "prकperties")); - } - @Test public void loadXml() throws Exception { PropertySource source = this.loader.load("test.xml", diff --git a/spring-boot/src/test/resources/org/springframework/boot/env/test-encoded.properties b/spring-boot/src/test/resources/org/springframework/boot/env/test-encoded.properties deleted file mode 100644 index 66c76610011..00000000000 --- a/spring-boot/src/test/resources/org/springframework/boot/env/test-encoded.properties +++ /dev/null @@ -1 +0,0 @@ -test=prकperties