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
|
@ -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