[ 
https://issues.apache.org/jira/browse/DERBY-1726?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Knut Anders Hatlen updated DERBY-1726:
--------------------------------------

    Attachment: d1726-encoding-1a.stat
                d1726-encoding-1a.diff

Here's an attempt to fix the encoding.

It seems like the problem was that ScriptTestCase.runTest() would always set 
the output encoding explicitly when calling ij.runScript(), so that 
derby.ui.codeset had no effect.

The patch makes it possible to set CanonTestCase's default output encoding to 
something other than US-ASCII, and it makes ScriptTestCase pass output encoding 
null to ij.runScript() if derby.ui.codeset is set.

Also, the SQL script for LocalizedDisplay was encoded in Cp932 which, as Kathey 
mentioned, is only supported by IBM's JVM. The test did however set 
derby.ui.codeset to EUC_JP, so I changed the input file to use the same 
encoding as the output file, and that appears to work in Sun's JVM as well. (I 
assume that EUC_JP also works in IBM's JVM since the test has been using that 
encoding for comparing the canon and the output for a long time already without 
causing any problems.)

The canons for LocalizedDisplay and LocalizedConnectionAttribute are now 
encoded in EUC_JP and ISO-8859-1, respectively, and the question marks are gone.

Additionally, I removed the check in the suite() methods that disabled the 
tests in non-English locales. If this turns out to be a problem, we should set 
the locale in setUp/tearDown instead of disabling the test.

I'll run the rest of the JUnit tests to see that these changes don't introduce 
other problems.

Does this sound like an OK solution?

> Make i18n/LocalizedDisplay.sql and i18n/LocalizedConnectionAttribute.sql 
> behave equally on different platforms
> --------------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-1726
>                 URL: https://issues.apache.org/jira/browse/DERBY-1726
>             Project: Derby
>          Issue Type: Bug
>          Components: Test
>    Affects Versions: 10.2.1.6
>            Reporter: Knut Anders Hatlen
>            Assignee: Myrna van Lunteren
>            Priority: Minor
>             Fix For: 10.5.0.0
>
>         Attachments: d1726-encoding-1a.diff, d1726-encoding-1a.stat, 
> DERBY-1726_1.diff, DERBY-1726_2.diff, DERBY-1726_3.diff, DERBY-1726_3.stat, 
> DERBY-1726_4.diff, DERBY-1726_5.diff, DERBY-1726_6.diff, DERBY-1726_7.diff, 
> DERBY-1726_7.stat, DERBY-1726_8.diff, props.java
>
>
> Myrna van Lunteren commented on DERBY-244:
> The one remark I have is that I still cannot get the LocalizedDisplay.sql and 
> LocalizedConnectionAttribute.sql test from the i18n directory to behave the 
> same under windows and Linux (with sun jdk 1.4.2.).
> For windows, I had to update the masters for these tests, but running them on 
> Linux still failed for me.
> With jdk131, ibm131 and ibm142 the LocalizedDisplay.sql test hung, and 
> LocalizedConnectionAttribute exits with a MalformedInputException.
> It would be nice if we could figure out a way to add these tests to the 
> suites...
> --- stack of LocalizedConnectionAttribute on Linux ---
> Exception in thread "main" sun.io.MalformedInputException
>         at sun.io.ByteToCharUTF8.convert(ByteToCharUTF8.java(Compiled Code))
>         at 
> sun.nio.cs.StreamDecoder$ConverterSD.convertInto(StreamDecoder.java:287)
>         at 
> sun.nio.cs.StreamDecoder$ConverterSD.implRead(StreamDecoder.java:337)
>         at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:223)
>         at java.io.InputStreamReader.read(InputStreamReader.java:208)
>         at java.io.BufferedReader.fill(BufferedReader.java:153)
>         at java.io.BufferedReader.readLine(BufferedReader.java:316)
>         at java.io.BufferedReader.readLine(BufferedReader.java:379)
>         at 
> org.apache.derbyTesting.functionTests.harness.RunTest.setDirectories(RunTest.java:729)
>         at 
> org.apache.derbyTesting.functionTests.harness.RunTest.main(RunTest.java:262)
> ---------------------------------------------------------------------------- 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to