Uploaded image for project: 'Directory Studio'
  1. Directory Studio
  2. DIRSTUDIO-1114

Bad encoding used in text editor for binary data

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.0.0-M10 (2.0.0.v20151221-M10)
    • Fix Version/s: 2.0.0-M12
    • Component/s: studio-ldapbrowser
    • Labels:
      None
    • Environment:
      Windows 7 x64

      Description

      On windows when an octet string ("Binary Data" as displayed by Directory Studio) is being edited as text (double click on attribute then click "Edit as Text..." in the opened hex editor) wrong encoding/code page is used and there is no way to set the encoding to the one that should be used.
      The Text Editor that is opened uses most likely CP1250 no matter what the string is encoded in. So an UTF-8 string is mostly uneditable.
      I assume the editor uses the default system encoding.
      I think this because on Linux the text is displayed/edited correctly, and nowadays Linux's use UTF-8 as default (albeit that would create the same artifacts if the strings were stored with some other encoding like eg. Windows-1252).

      The correct behavior for the Text Editor windows would be to honor the global Eclipse workspace setting regarding the encoding of text files.

      As about the concrete circumstances to reproduce the error:
      I was editing a vacationInfo attribute (OID: 1.3.6.1.4.1.11048.1.1.1.3 type: binary)

        Activity

        Hide
        seelmann Stefan Seelmann added a comment -

        Fixed: http://svn.apache.org/viewvc?rev=1758860&view=rev

        You are right, the default system encoding was used to convert the binary data to string. I choosed to always use UTF-8 instead of checking the workspace setting because the edited data is not loaded from local filesystem but from remote LDAP server, and in general LDAP uses UTF-8.

        Show
        seelmann Stefan Seelmann added a comment - Fixed: http://svn.apache.org/viewvc?rev=1758860&view=rev You are right, the default system encoding was used to convert the binary data to string. I choosed to always use UTF-8 instead of checking the workspace setting because the edited data is not loaded from local filesystem but from remote LDAP server, and in general LDAP uses UTF-8.
        Hide
        seelmann Stefan Seelmann added a comment -

        Forgot to set encoding for reverse way text to binary: http://svn.apache.org/viewvc?rev=1758863&view=rev

        Show
        seelmann Stefan Seelmann added a comment - Forgot to set encoding for reverse way text to binary: http://svn.apache.org/viewvc?rev=1758863&view=rev

          People

          • Assignee:
            seelmann Stefan Seelmann
            Reporter:
            tylla Nagy Attila
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development