[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug cp-tools/30346] New: "Native2ASCII -reversed" fails if \u00e9 is no
From: |
qwert2003 at users dot sourceforge dot net |
Subject: |
[Bug cp-tools/30346] New: "Native2ASCII -reversed" fails if \u00e9 is not followed by any char |
Date: |
1 Jan 2007 21:23:52 -0000 |
Using gnu.classpath.tools.native2ascii.Native2ASCII with option -reversed
to convert \u00e9 into é (e with acute).
This is just an example letter, the problem occurs with an char.
1) Example when conversion fails
INPUT
:~> echo "\u00e9"|gij -classpath
/usr/share/java/glibj.jar:/usr/share/classpath/tools.zip
gnu.classpath.tools.native2ascii.Native2ASCII --reversed
OUTPUT
\u00e9
No conversion is done, output=input. No error message.
Expected result is "é" (e with acute).
2) Example when conversion works
INPUT (Note the trailing space in echo "\u00e9 ")
:~> echo "\u00e9 "|gij -classpath
/usr/share/java/glibj.jar:/usr/share/classpath/tools.zip
gnu.classpath.tools.native2ascii.Native2ASCII --reversed
OUTPUT
é
The output is the expected result. This is always the case when the hex-value
is not at the very end of the line.
3) Reason / Fix
The reason seems to be in line 146 of
gnu.classpath.tools.native2ascii.Native2ASCII.java:
if (reversed && i + 6 < s.length() && etc.
should probably be:
if (reversed && i + 6 <= s.length() && etc.
--
Summary: "Native2ASCII -reversed" fails if \u00e9 is not followed
by any char
Product: classpath
Version: 0.93
Status: UNCONFIRMED
Severity: minor
Priority: P3
Component: cp-tools
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: qwert2003 at users dot sourceforge dot net
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30346
- [Bug cp-tools/30346] New: "Native2ASCII -reversed" fails if \u00e9 is not followed by any char,
qwert2003 at users dot sourceforge dot net <=