enforce UTF-8 encoding in data streams
[svjatoslav_commons.git] / src / main / java / eu / svjatoslav / commons / data / EnhancedDataInputStream.java
index 4adc080..b0db879 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Svjatoslav Commons - shared library of common functionality.
- * Copyright (C) 2012, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
+ * Copyright ©2012-2013, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
  * 
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of version 2 of the GNU General Public License
@@ -41,7 +41,7 @@ public class EnhancedDataInputStream extends DataInputStream {
                final byte[] bytes = new byte[length];
                readFully(bytes);
 
-               return new String(bytes);
+               return new String(bytes, "UTF-8");
        }
 
 }