Fixed data loss when decoding Windows-1252 text with accented characters

This commit is contained in:
Vhati 2013-08-24 12:00:04 -04:00
parent ef135052b3
commit eae6aabf61
2 changed files with 3 additions and 0 deletions

View file

@ -3,6 +3,7 @@ Changelog
???:
- Added LF to CR-LF conversion for *.xml.append, *.xml, and *.txt
- Added a Validate warning for text files with LF line endings
- Fixed data loss when decoding Windows-1252 text with accented characters
1.0:
- Changed mod list to a table with checkboxes

View file

@ -93,6 +93,8 @@ public class ModUtilities {
Map<String,Exception> errorMap = new LinkedHashMap<String,Exception>();
for ( String guess : new String[] {"UTF-8", "windows-1252"} ) {
try {
byteBuffer.rewind();
byteBuffer.limit( allBytes.length );
CharsetDecoder decoder = Charset.forName( guess ).newDecoder();
result = decoder.decode( byteBuffer ).toString();
encoding = guess;