harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Regis Xu (JIRA)" <j...@apache.org>
Subject [jira] Created: (HARMONY-6037) [classlib][portlib] bug of converting unicode to utf-8 in hyerrorhelpers.c::errorMessage
Date Tue, 09 Dec 2008 03:11:44 GMT
[classlib][portlib] bug of converting unicode to utf-8 in hyerrorhelpers.c::errorMessage

                 Key: HARMONY-6037
                 URL: https://issues.apache.org/jira/browse/HARMONY-6037
             Project: Harmony
          Issue Type: Bug
          Components: Classlib
    Affects Versions: 5.0M8
            Reporter: Regis Xu
             Fix For: 5.0M9

after applying following patch:

Index: modules/luni/src/main/native/luni/shared/OSFileSystem.c
--- modules/luni/src/main/native/luni/shared/OSFileSystem.c
+++ modules/luni/src/main/native/luni/shared/OSFileSystem.c
@@ -240,6 +240,9 @@ JNIEXPORT jlong JNICALL Java_org_apache_harmony_luni_platform_OSFileSystem_openI
       ioh_convertToPlatform (pathCopy);
       portFD = hyfile_open (pathCopy, flags, mode);
+      if (portFD < 0) {
+          throwNewExceptionByName(env, "java/io/FileNotFoundException", hyfile_error_message());
+      }
       return (jlong)portFD;
and run the test in Harmony-6034, I got unrecognized characters, it should be Chinese characters

I fond that, in hyerrorhelpers.c::errorMessage,  need to convert unicode got from Windows
to utf-8 for java use.
When convert to multi-bytes ( > 0x80), the order of bytes is totally reversed.

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message