[ 
https://issues.apache.org/jira/browse/DERBY-4757?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12916420#action_12916420
 ] 

Knut Anders Hatlen commented on DERBY-4757:
-------------------------------------------

Hi Tiago,

I don't think the server-side changes (DDMWriter) in the latest patch are 
correct. writeString() and writeLDString() are not used for writing DRDA 
commands, so they don't go through the ccsid manager. These strings are encoded 
in UTF-8 also in those versions of Derby that encode DRDA commands in EBCDIC. 
Since these methods now use the ccsid manager for getting the byte length of 
the string, although the string is always encoded in UTF-8, the length may be 
wrong when talking to older clients.

For example, I see this when I connect with a 10.6.2.1 client to a server 
running trunk with the patch:

ij version 10.6
ij> connect 'jdbc:derby://localhost/db;create=true';
ij> values 'æøå';
1  
---
æ  

1 row selected
ij> values 'vêrhane';
1      
-------
vêrhan 

1 row selected

Notice how the returned strings are truncated because the EBCDIC ccsid manager 
returns a shorter byte length than what the actual UTF-8 encoding results in.

> (Client) Implement UTF8 support on DRDA
> ---------------------------------------
>
>                 Key: DERBY-4757
>                 URL: https://issues.apache.org/jira/browse/DERBY-4757
>             Project: Derby
>          Issue Type: Sub-task
>          Components: Network Client
>    Affects Versions: 10.7.0.0
>            Reporter: Tiago R. Espinha
>            Assignee: Tiago R. Espinha
>         Attachments: DERBY-4757_donotcommit.diff, DERBY-4757_p1.diff, 
> DERBY-4757_p2.diff, DERBY-4757_p3.diff, DERBY-4757_p3.diff, DERBY-4757_p3.diff
>
>
> This issue is DERBY-4746's counterpart for the client changes required to 
> implement UTF8 support in DRDA.

-- 
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