Bug 152122 - 'Change Value' handles multibyte-string with improper encoding
Summary: 'Change Value' handles multibyte-string with improper encoding
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: PDT (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P2 normal (vote)
Target Milestone: ---   Edit
Assignee: Shalom Gibly CLA
QA Contact:
URL:
Whiteboard:
Keywords: plan
Depends on:
Blocks:
 
Reported: 2006-07-28 06:53 EDT by Toshihiro Izumi CLA
Modified: 2020-05-14 11:08 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Toshihiro Izumi CLA 2006-07-28 06:53:46 EDT
'Change Value' handles multibyte-string with improper encoding.
In Variables View, viewing variables is OK. It seems to obey 'Debug Transfer Encoding'.
However, if I open 'Change Value' and simply click OK button, then multibyte-characters will be broken.
If I enter 'mb_convert_encoding("...", mb_internal_encoding(), "Windows-31J")' as value, it's OK, I can see correct characters. (Windows-31J is the system default encoding of my pc)
Proper conversion should be applied in changing value.
Comment 1 Shalom Gibly CLA 2006-09-07 11:11:30 EDT
Assigned for further investigation
Comment 2 Toshihiro Izumi CLA 2006-10-16 22:19:54 EDT
Well, 'Change Value' walks
PHPVariabe#setValue
->DefaultExpressionsManager#assignValue
  ->RemoteDebugger#assignValue
    ->DebugConnectionThread#sendRequest
      ->AssignValueRequest#serialize
        =>convert encoding with fEncoding but fEncoding is *null*

This is my TEST code in RemoteDebugger.java. (It will not be an appropriate module.)
[code]
public boolean assignValue(String var, String value, int depth, String[] path) {
    if (!this.isActive()) {
        return false;
    }
    AssignValueRequest request = new AssignValueRequest();
    request.setVar(var);
    request.setValue(value);
    request.setDepth(depth);
    request.setPath(path);
    //XXX-
    try {
        String enc = debugHandler.getDebugTarget().getLaunch().getLaunchConfiguration().getAttribute(IDebugParametersKeys.TRANSFER_ENCODING, "");
        request.setTransferEncoding(enc);
    } catch (CoreException e) {
        e.printStackTrace();
    }
    //-XXX
    try {
        connection.sendRequest(request);
        return true;
    } catch (Exception exc) {
        exc.printStackTrace();
    }
    return false;
}
[/code]

This works. I can change value with multibyte-string.
It is necessary to set encoding...somewhere.
Comment 3 Shalom Gibly CLA 2007-02-18 10:54:17 EST
Fixed.
Set the AssignValueRequest transfer encoding to the debug transfer encoding 
that is set in the preferences.
Comment 4 Gadi Goldbarg CLA 2007-02-21 07:37:58 EST
fixed