UnicodeToBytes.java (write(String,int,int,char[])): New overloading, allows greater efficiency.

�
	* gnu/gcj/convert/UnicodeToBytes.java (write(String,int,int,char[])):
	New overloading, allows greater efficiency.
	* gnu/gcj/convert/Output_8859_1.java (write(String,int,int,char[])):
	New overloading (for efficiency - avoids copying).
	* gnu/gcj/convert/Output_UTF8.java:  Fix typo: 0xC0 -> 0c3F.
	* gnu/gcj/convert/Input_UTF8.java:  Fix typos in bit masks.

From-SVN: r26494
This commit is contained in:
Per Bothner
1999-04-16 10:22:02 -07:00
parent c80eb46728
commit 2012fd2db0
3 changed files with 51 additions and 4 deletions
+8 -2
View File
@@ -8,6 +8,12 @@ details. */
package gnu.gcj.convert;
/**
* Convert UTF8 to Unicode.
* @author Per Bothner <bothner@cygnus.com>
* @date Match 1999.
*/
public class Input_UTF8 extends BytesToUnicode
{
public String getName() { return "UTF8"; }
@@ -84,12 +90,12 @@ public class Input_UTF8 extends BytesToUnicode
}
else // prefix byte
{
if ((b & 0xE) == 0xC0)
if ((b & 0xE0) == 0xC0)
{
partial = b & 0x1F;
partial_bytes_expected = 1;
}
else if ((b & 0xF) == 0xF0)
else if ((b & 0xF0) == 0xE0)
{
partial = b & 0xF;
partial_bytes_expected = 2;