harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From telli...@apache.org
Subject svn commit: r724596 - /harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/windows/hyerrorhelpers.c
Date Tue, 09 Dec 2008 03:46:37 GMT
Author: tellison
Date: Mon Dec  8 19:46:36 2008
New Revision: 724596

URL: http://svn.apache.org/viewvc?rev=724596&view=rev
Log:
Patch for HARMONY-6037 ([classlib][portlib] bug of converting unicode to utf-8 in hyerrorhelpers.c::errorMessage)

Modified:
    harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/windows/hyerrorhelpers.c

Modified: harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/windows/hyerrorhelpers.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/windows/hyerrorhelpers.c?rev=724596&r1=724595&r2=724596&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/windows/hyerrorhelpers.c
(original)
+++ harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/windows/hyerrorhelpers.c
Mon Dec  8 19:46:36 2008
@@ -101,6 +101,7 @@
   rc =
     MultiByteToWideChar (CP_ACP, MB_PRECOMPOSED, buffer, -1, ubuffer,
 			 HYERROR_DEFAULT_BUFFER_SIZE);
+
   if (rc == 0)
     {
       const char *format;
@@ -142,16 +143,16 @@
 	{
 	  if ((out + 3) >= HYERROR_DEFAULT_BUFFER_SIZE)
 	    break;
-	  message[out++] = (char) (0x80 | (ch & 0x3f));
 	  message[out++] = (char) (0xc0 | (ch >> 6));
+	  message[out++] = (char) (0x80 | (ch & 0x3f));
 	}
       else
 	{
 	  if ((out + 4) >= HYERROR_DEFAULT_BUFFER_SIZE)
 	    break;
-	  message[out++] = (char) (0x80 | (ch & 0x3f));
-	  message[out++] = (char) (0x80 | ((ch >> 6) & 0x3f));
 	  message[out++] = (char) (0xe0 | (ch >> 12));
+	  message[out++] = (char) (0x80 | ((ch >> 6) & 0x3f));
+	  message[out++] = (char) (0x80 | (ch & 0x3f));
 	}
     }
   message[out] = '\0';



Mime
View raw message