groovy-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pascalschumac...@apache.org
Subject incubator-groovy git commit: fix for GROOVY-7461 (closes #36)
Date Tue, 09 Jun 2015 15:59:05 GMT
Repository: incubator-groovy
Updated Branches:
  refs/heads/master 043f52a49 -> 66c424af8


fix for GROOVY-7461 (closes #36)


Project: http://git-wip-us.apache.org/repos/asf/incubator-groovy/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-groovy/commit/66c424af
Tree: http://git-wip-us.apache.org/repos/asf/incubator-groovy/tree/66c424af
Diff: http://git-wip-us.apache.org/repos/asf/incubator-groovy/diff/66c424af

Branch: refs/heads/master
Commit: 66c424af81de205bbe2deb2d2807617b4db75096
Parents: 043f52a
Author: Keegan Witt <keeganwitt@gmail.com>
Authored: Tue Jun 9 08:53:07 2015 -0400
Committer: pascalschumacher <pascalschumacher@gmx.net>
Committed: Tue Jun 9 17:57:47 2015 +0200

----------------------------------------------------------------------
 src/main/org/codehaus/groovy/runtime/ResourceGroovyMethods.java | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-groovy/blob/66c424af/src/main/org/codehaus/groovy/runtime/ResourceGroovyMethods.java
----------------------------------------------------------------------
diff --git a/src/main/org/codehaus/groovy/runtime/ResourceGroovyMethods.java b/src/main/org/codehaus/groovy/runtime/ResourceGroovyMethods.java
index e390393..b45b54b 100644
--- a/src/main/org/codehaus/groovy/runtime/ResourceGroovyMethods.java
+++ b/src/main/org/codehaus/groovy/runtime/ResourceGroovyMethods.java
@@ -40,6 +40,7 @@ import java.net.URI;
 import java.net.URISyntaxException;
 import java.net.URL;
 import java.net.URLConnection;
+import java.nio.charset.Charset;
 import java.util.Arrays;
 import java.util.ArrayList;
 import java.util.HashMap;
@@ -1817,9 +1818,9 @@ public class ResourceGroovyMethods extends DefaultGroovyMethodsSupport
{
     }
 
     private static void writeUTF16BomIfRequired(final String charset, final OutputStream
stream) throws IOException {
-        if ("UTF-16BE".equals(charset)) {
+        if ("UTF-16BE".equals(Charset.forName(charset).name())) {
             writeUtf16Bom(stream, true);
-        } else if ("UTF-16LE".equals(charset)) {
+        } else if ("UTF-16LE".equals(Charset.forName(charset).name())) {
             writeUtf16Bom(stream, false);
         }
     }


Mime
View raw message