[tcljava-dev] Re: [tcljava-user] Tcl/Java 1.3.0 release is online.
Brought to you by:
mdejong
From: Mo D. <md...@un...> - 2003-03-18 17:51:21
|
On Tue, 18 Mar 2003 09:07:38 -0800 "Rob Ratcliff" <rr...@fu...> wrote: > Hi Mo, Hi Rob. > ==== unicode-3.2 convert to encoded string FAILED > ==== Contents of test case: > > set str "\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\" > set enc [encoding convertto jis0208 $str] > string compare $enc "!)!)!)!)!)!)!)!)!)!)!)!)!)!)!)" > > ---- Result was: > 1 > ---- Result should have been: > 0 > ==== unicode-3.2 FAILED I have seen this failure before. Tcl does not seem to agree with Java about how the jis0208 encoding should work. > tcl/string.test > > ==== string-6.14 string is alnum, unicode FAILED > ==== Contents of test case: > > string is alnum abc? > > ---- Result was: > 0 > ---- Result should have been: > 1 > ==== string-6.14 FAILED Humm, this is strange. I do not see this, along with the other string errors you are running into on my machine. The implementation inside jacl's StringCmd.java seems to just call Character.isLetterOrDigit(char) for each character in the string. You might try to execute this in you Jacl shell, it returns {1 1 1 1} for me. list \ [java::call Character isLetterOrDigit a] \ [java::call Character isLetterOrDigit b] \ [java::call Character isLetterOrDigit c] \ [java::call Character isLetterOrDigit \xfc] The character is just written in the string.test file, it is not escaped so perhaps that combined with some encoding issue has something to do with this. You could try pasting the string from the file into the test above, instead of using the \xfc and see if that works. > tcljava/JavaDefineClassCmd.test > > ==== java::defineclass-2.1 loading a class FAILED > ==== Contents of test case: > > set file [open [file join $javaload_full_path Test1Cmd.class]] > fconfigure $file -translation binary > set bytes [read $file] > close $file > set class [java::defineclass $bytes] > java::isnull $class > > ---- Result was: > 1 > ---- Result should have been: > 0 > ==== java::defineclass-2.1 FAILED Strange, this one does not fail on my system. It is not clear if this is the fault of the new IO layer or something having gone wrong in the defineclass command. Could you add some debug statements to see if the correct number of bytes is being read in for this .class file? cheers Mo |