ECJ-INTEREST-L Archives

March 2011

ECJ-INTEREST-L@LISTSERV.GMU.EDU

Options: Use Proportional Font
Show HTML Part by Default
Condense Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Sender:
ECJ Evolutionary Computation Toolkit <[log in to unmask]>
Subject:
From:
Ben Stabile <[log in to unmask]>
Date:
Wed, 2 Mar 2011 16:50:50 -0500
Content-Type:
multipart/alternative; boundary=20cf30549e7dfe185a049d86e728
MIME-Version:
1.0
Reply-To:
ECJ Evolutionary Computation Toolkit <[log in to unmask]>
Parts/Attachments:
text/plain (1109 bytes) , text/html (1816 bytes)
Encoding/decoding of strings was not working correctly with escape
characters for me. I had to change the decoding switch case somewhat because
it was falling into the "unicode sequence" trap for no apparent reason.

The following change was necessary to make this work (but see the warning
below before making this change without checking your own sources):

[Code.java, line 479]

                else if (c=='\\')  // escape
                    {
                    x++;
                    if ( x >= len )
                        { d.type = DecodeReturn.T_ERROR; d.s = "Unterminated
String"; return; }
                    if (dat.charAt(x)!='u' *&& inUnicode*)
                        { d.type = DecodeReturn.T_ERROR; d.s = "Escape
character in Unicode sequence"; return; }
                    switch (dat.charAt(x))
...

CAVEAT EMPTOR: I am working with significantly altered sources at the
moment, so this may not show up for others the way it has for me. I am
referencing the original source code linenumber above. If you don't use the
"Code" class for this kind of thing, you might want to just ignore this. ;-)

Regards,
Ben S.


ATOM RSS1 RSS2