This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-vfs.git


The following commit(s) were added to refs/heads/master by this push:
     new 7c56b5a  IllegalArgumentException: Bad escape for Chinese characters 
in FileObject path #168.
7c56b5a is described below

commit 7c56b5ab5e7826ddc443936d11145ee1be077e95
Author: Gary Gregory <garydgreg...@gmail.com>
AuthorDate: Sun Mar 28 17:31:40 2021 -0400

    IllegalArgumentException: Bad escape for Chinese characters in
    FileObject path #168.
---
 commons-vfs2/src/main/java/org/apache/commons/vfs2/FileObject.java     | 2 +-
 .../java/org/apache/commons/vfs2/FileObjectEscapeChartInPathTest.java  | 2 --
 src/changes/changes.xml                                                | 3 +++
 3 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/commons-vfs2/src/main/java/org/apache/commons/vfs2/FileObject.java 
b/commons-vfs2/src/main/java/org/apache/commons/vfs2/FileObject.java
index fce79ac..1f5e2d2 100644
--- a/commons-vfs2/src/main/java/org/apache/commons/vfs2/FileObject.java
+++ b/commons-vfs2/src/main/java/org/apache/commons/vfs2/FileObject.java
@@ -307,7 +307,7 @@ public interface FileObject extends Comparable<FileObject>, 
Iterable<FileObject>
      * @since 2.7.0
      */
     default URI getURI() {
-        return URI.create(getName().getURI());
+        return URI.create(URI.create(getName().getURI()).toASCIIString());
     }
 
     /**
diff --git 
a/commons-vfs2/src/test/java/org/apache/commons/vfs2/FileObjectEscapeChartInPathTest.java
 
b/commons-vfs2/src/test/java/org/apache/commons/vfs2/FileObjectEscapeChartInPathTest.java
index 8419dcc..66ab4b3 100644
--- 
a/commons-vfs2/src/test/java/org/apache/commons/vfs2/FileObjectEscapeChartInPathTest.java
+++ 
b/commons-vfs2/src/test/java/org/apache/commons/vfs2/FileObjectEscapeChartInPathTest.java
@@ -34,10 +34,8 @@ import org.apache.commons.io.IOUtils;
 import org.apache.commons.lang3.SystemUtils;
 import org.apache.commons.lang3.function.FailableFunction;
 import org.apache.commons.vfs2.impl.StandardFileSystemManager;
-import org.junit.Ignore;
 import org.junit.Test;
 
-@Ignore
 public class FileObjectEscapeChartInPathTest {
 
     private static final String REL_PATH_GREAT = 
"src/test/resources/test-data/好.txt";
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index cac0154..56c4001 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -56,6 +56,9 @@ The <action> type attribute can be add,update,fix,remove.
       <action type="fix" dev="ggregory" due-to="Boris Petrov, Gary Gregory, 
Max Kellermann">
         Fix NPE when closing a stream from a different thread #167. See also 
#166.
       </action>
+      <action type="fix" dev="ggregory" issue="VFS-798" due-to="XenoAmess, 
Gary Gregory">
+        IllegalArgumentException: Bad escape for Chinese characters in 
FileObject path #168.
+      </action>
       <!-- UPDATES  -->
       <action type="update" dev="ggregory" due-to="Arturo Bernal">
         Replace construction of FileInputStream and FileOutputStream objects 
with Files NIO APIs. #164.

Reply via email to