Fixed data loss when decoding Windows-1252 text with accented characters
This commit is contained in:
parent
ef135052b3
commit
eae6aabf61
2 changed files with 3 additions and 0 deletions
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue