Merge pull request #10565 from thiagohirata/fix/#10564
* pr/10565: Update OriginTrackedPropertiesLoader to ISO 8859-1
This commit is contained in:
commit
f35af88de5
|
|
@ -37,6 +37,7 @@ import org.springframework.util.Assert;
|
||||||
*
|
*
|
||||||
* @author Madhura Bhave
|
* @author Madhura Bhave
|
||||||
* @author Phillip Webb
|
* @author Phillip Webb
|
||||||
|
* @author Thiago Hirata
|
||||||
*/
|
*/
|
||||||
class OriginTrackedPropertiesLoader {
|
class OriginTrackedPropertiesLoader {
|
||||||
|
|
||||||
|
|
@ -154,7 +155,7 @@ class OriginTrackedPropertiesLoader {
|
||||||
|
|
||||||
CharacterReader(Resource resource) throws IOException {
|
CharacterReader(Resource resource) throws IOException {
|
||||||
this.reader = new LineNumberReader(
|
this.reader = new LineNumberReader(
|
||||||
new InputStreamReader(resource.getInputStream()));
|
new InputStreamReader(resource.getInputStream(), "8859_1"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
||||||
|
|
@ -228,6 +228,12 @@ public class OriginTrackedPropertiesLoaderTests {
|
||||||
assertThat(getLocation(mango)).isEqualTo("27:1");
|
assertThat(getLocation(mango)).isEqualTo("27:1");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void getPropertyWithISO88591Character() throws Exception {
|
||||||
|
OriginTrackedValue value = this.properties.get("test-iso8859-1-chars");
|
||||||
|
assertThat(getValue(value)).isEqualTo("æ×ÈÅÞßáñÀÿ");
|
||||||
|
}
|
||||||
|
|
||||||
private Object getValue(OriginTrackedValue value) {
|
private Object getValue(OriginTrackedValue value) {
|
||||||
return (value == null ? null : value.getValue());
|
return (value == null ? null : value.getValue());
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -37,3 +37,6 @@ test-property-value-comment=foo \
|
||||||
!bar #foo
|
!bar #foo
|
||||||
test-multiline-immediate-bang=\
|
test-multiline-immediate-bang=\
|
||||||
!foo
|
!foo
|
||||||
|
|
||||||
|
#test ISO 8859-1
|
||||||
|
test-iso8859-1-chars=ć×ČĹŢßáńŔ˙
|
||||||
Loading…
Reference in New Issue