vscode-ibmi icon indicating copy to clipboard operation
vscode-ibmi copied to clipboard

Quoted member names containing special characters are not rendered correctly

Open SanjulaGanepola opened this issue 1 year ago • 10 comments
trafficstars

When using a user profile with German CCSID 273, we noticed that the first character of this quoted member name is not correct as displayed in the Object Browser. I have included below the correct result. The character displays fine in the member text.

Code4i: image

5250: image

When debugging the extension, I see that an SQL command like the following is run which returns the incorrect character:

With MEMBERS As (
        SELECT
          rtrim(cast(a.system_table_schema as char(10) for bit data)) as LIBRARY,
          b.avgrowsize as RECORD_LENGTH,
          a.iasp_number as ASP,
          rtrim(cast(a.system_table_name as char(10))) AS SOURCE_FILE,
          rtrim(cast(b.system_table_member as char(10))) as NAME,
          coalesce(rtrim(cast(b.source_type as varchar(10))), '') as TYPE,
          coalesce(rtrim(varchar(b.partition_text)), '') as TEXT,
          b.NUMBER_ROWS as LINES,
          extract(epoch from (b.CREATE_TIMESTAMP))*1000 as CREATED,
          extract(epoch from (b.LAST_SOURCE_UPDATE_TIMESTAMP))*1000 as CHANGED
        FROM qsys2.systables AS a
          JOIN qsys2.syspartitionstat AS b
            ON b.table_schema = a.table_schema AND
              b.table_name = a.table_name
      )
      Select * From MEMBERS
      Where LIBRARY = 'AURORADEU'
        And SOURCE_FILE = 'QCBLLESRC'
        And NAME Like '%'
        And TYPE Like '%'
      Order By NAME ASC

image


Context Version
Code for IBM i version 2.10.2
Visual Studio Code version 1.89.1
Operating System win32_x64
Active extensions
Code for IBM i Walkthroughs (vscode-ibmi-walkthroughs): 0.5.0
Db2 for IBM i (vscode-db2i): 1.0.0
Emmet (emmet): 1.0.0
Git (git): 1.0.0
Git Base (git-base): 1.0.0
GitHub (github): 0.0.1
GitHub Authentication (github-authentication): 0.0.2
IBM i Debug (ibmidebug): 1.0.0
JSON Language Features (json-language-features): 1.0.0
Merge Conflict (merge-conflict): 1.0.0
Node Debug Auto-attach (debug-auto-launch): 1.0.0
TODO Highlight (vscode-todo-highlight): 1.0.5
TypeScript and JavaScript Language Features (typescript-language-features): 1.0.0
WCA@IBM (wca-at-ibm): 6.0.0
WSL (remote-wsl): 0.88.2

Remote system
Setting Value
IBM i OS n/a
Tech Refresh n/a
CCSID Origin undefined
Runtime CCSID 273
Default CCSID 273
SQL Enabled
Source dates Disabled

Enabled features

/QOpenSys/pkgs/bin /usr/bin /QSYS.lib/ILEDITOR.lib /QSYS.LIB /QIBM/ProdData/IBMiDebugService/bin
bash attr GETNEWLIBL.PGM QZDFMDB2.PGM startDebugService.sh
chsh iconv
git setccsid
grep
ls
md5sum
sort
stat
tar
tn5250
Shell env
BUILDLIB=AURORADEU
CURLIB=AURORADEU
HOME=/home/AURORADEU
HOST=p8adt05.rch.stglabs.ibm.com
LIBLS=QTEMP QGPL TESTTOOLS
LOGIN=auroradeu
LOGNAME=auroradeu
MAIL=/var/spool/mail/auroradeu
OLDPWD=/home/AURORADEU
PATH=/QOpenSys/pkgs/bin:/QOpenSys/usr/bin:/usr/ccs/bin:/QOpenSys/usr/bin/X11:/usr/sbin:.:/usr/bin
PWD=/home/AURORADEU
SHELL=/QOpenSys/pkgs/bin/bash
SHLVL=1
SSH_CLIENT=9.67.94.213 49300 22
SSH_CONNECTION=9.67.94.213 49300 9.5.12.241 22
TZ=<UTC>0
USER=auroradeu
USERNAME=AURORADEU
WORKDIR=/home/AURORADEU
_=/QOpenSys/pkgs/bin/env
Variants
{
  "american": "#@$",
  "local": "#@$"
}
Errors
[
  {
    "command": "/QOpenSys/usr/bin/qsh",
    "code": 1,
    "stderr": "CPF2111:  Library ILEDITOR already exists.",
    "cwd": "/home/AURORADEU"
  },
  {
    "command": "ls undefined",
    "code": 2,
    "stderr": "ls: cannot access 'undefined': No such file or directory",
    "cwd": "/home/AURORADEU"
  }
]

SanjulaGanepola avatar May 16 '24 20:05 SanjulaGanepola

2.10.2 is a prerelease and not production ready. I am looking into a fix but it could be a few days.

worksofliam avatar May 17 '24 14:05 worksofliam

@SanjulaGanepola are you able to share the entire output log?

worksofliam avatar May 17 '24 14:05 worksofliam

The full log: output.txt

SanjulaGanepola avatar May 17 '24 14:05 SanjulaGanepola

@SanjulaGanepola any way you can provide steps to recreate this at all?

worksofliam avatar May 18 '24 18:05 worksofliam

Test PR started -> #2068

SanjulaGanepola avatar May 22 '24 17:05 SanjulaGanepola

@sebjulliand I think a PR you just worked on recently solved this?

worksofliam avatar Sep 03 '24 01:09 worksofliam

@sebjulliand I think a PR you just worked on recently solved this?

That's worth a new try at least 😅

sebjulliand avatar Sep 03 '24 08:09 sebjulliand

@sebjulliand Just had a try and looks like I can still reproduce the same issues as before. Note that there is some overlap between this issue and https://github.com/codefori/vscode-ibmi/issues/2088.

QCCSID 37 + User Profile CCSID 273

  • Variant characters in quoted object names are broken
  • Variant characters in object/member descriptions are broken image

QCCSID 65535 + User Profile CCSID 273

  • Variant characters in quoted object names are broken
  • Variant characters in object/member descriptions are not broken image

Expected Result image

image

SanjulaGanepola avatar Sep 03 '24 16:09 SanjulaGanepola

@SanjulaGanepola Does https://github.com/codefori/vscode-ibmi/pull/2068 still solve this issue?

worksofliam avatar Sep 03 '24 16:09 worksofliam

It appears to have fixed the object and member descriptions, but not the quoted object name. I did notice that quoted library names are fine, but expanding it does not show any source physicals, but this may be related to issues with supporting double quotes (https://github.com/codefori/vscode-ibmi/pull/2068#issuecomment-2144457725)

image

SanjulaGanepola avatar Sep 03 '24 18:09 SanjulaGanepola

We believe to have solved this issue. You can switch to the pre-release to try the fix.

worksofliam avatar Nov 26 '24 14:11 worksofliam