* limitations under the License.
*/
+/*
+ * Changes (@author niki):
+ * - default charset -> UTF-8
+ */
+
package be.nikiroo.utils.streams;
import java.io.UnsupportedEncodingException;
* incorrect padding
*/
public static byte[] decode(String str, int flags) {
- return decode(str.getBytes(), flags);
+ try{
+ return decode(str.getBytes("UTF-8"), flags);
+ } catch (UnsupportedEncodingException e) {
+ // All conforming JVM are expected to support UTF-8
+ return null;
+ }
}
/**