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:50 GMT
Repository: incubator-groovy
Updated Branches:
  refs/heads/GROOVY_2_4_X 198805c9b -> 68136a88e


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/68136a88
Tree: http://git-wip-us.apache.org/repos/asf/incubator-groovy/tree/68136a88
Diff: http://git-wip-us.apache.org/repos/asf/incubator-groovy/diff/68136a88

Branch: refs/heads/GROOVY_2_4_X
Commit: 68136a88e1b274f3bc2fff90531fff5840c15d1a
Parents: 198805c
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:59:33 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/68136a88/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 e0df6b8..5b2bcac 100644
--- a/src/main/org/codehaus/groovy/runtime/ResourceGroovyMethods.java
+++ b/src/main/org/codehaus/groovy/runtime/ResourceGroovyMethods.java
@@ -39,6 +39,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.HashMap;
 import java.util.List;
@@ -1763,9 +1764,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