Special Characters getting convert to slash (/)
This was discussed in the 1/17/25 Code for IBM i Zoom call. I had recently seen it so I was able to reproduce it easily.
We have some source members with the tab character in them (x'05'). I have no idea how they got in there!
When first loaded they look fine. If you save them, close them, and reopen them you will then see the slash (/) character. I've attached a screenshot of the slashes and the "output" tab from VS Code. If you need anything else let me know.
| Context | Version |
|---|---|
| Code for IBM i version | 2.14.5 |
| Visual Studio Code version | 1.95.3 |
| Operating System | win32_x64 |
Active extensions
Code for IBM i Walkthroughs (vscode-ibmi-walkthroughs): 0.5.0
Configuration Editing (configuration-editing): 1.0.0
Db2 for IBM i (vscode-db2i): 1.8.0
ESLint (vscode-eslint): 3.0.10
Emmet (emmet): 1.0.0
Error Lens (errorlens): 3.22.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
GitLens — Git supercharged (gitlens): 16.2.0
IBM i Debug (ibmidebug): 2.0.2
IBM i Project Explorer (vscode-ibmi-projectexplorer): 2.12.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
RPGLE (vscode-rpgle): 0.28.6
Source Orbit (vscode-sourceorbit): 1.0.2
TODO Highlight (vscode-todo-highlight): 1.0.5
TypeScript and JavaScript Language Features (typescript-language-features): 1.0.0
Remote system
| Setting | Value |
|---|---|
| IBM i OS | V7R5M0 |
| Tech Refresh | n/a |
| CCSID Origin | 37 |
| Runtime CCSID | 37 |
| Default CCSID | 37 |
| SSHD CCSID | ? |
| cqsh | true |
| SQL | Enabled |
| Source dates | Enabled |
Enabled features
| /QOpenSys/pkgs/bin | /usr/bin | /QSYS.lib/ILEDITOR.lib | /QSYS.LIB | /QIBM/ProdData/IBMiDebugService/bin | /QOpenSys/QIBM/ProdData/JavaVM/jdk80 | /QOpenSys/QIBM/ProdData/JavaVM/jdk11 |
|---|---|---|---|---|---|---|
| bash | attr | GETNEWLIBL.PGM | QZDFMDB2.PGM | startDebugService.sh | 64bit | 64bit |
| find | iconv | |||||
| git | setccsid | |||||
| grep | uname | |||||
| ls | ||||||
| md5sum | ||||||
| sort | ||||||
| stat | ||||||
| tar |
Shell env
BUILDLIB=EMPBJG
CURLIB=EMPBJG
HOME=/home/BRIAN
HOST=dev01
LIBLS=PROFOUNDUI QTEMP QGPL VGPL TECHCOMMON VIPDEVELOP VVIPEYE
LOGIN=brian
LOGNAME=brian
MAIL=/var/spool/mail/brian
PASE_USRGRP_LIMITED=N
PATH=/QOpenSys/usr/bin:/usr/ccs/bin:/QOpenSys/usr/bin/X11:/usr/sbin:.:/usr/bin
SHELL=/QOpenSys/usr/bin/bsh
SSH_CLIENT=172.18.34.54 61093 22
SSH_CONNECTION=172.18.34.54 61093 172.20.10.240 22
TZ=<EST>5<EDT>,M3.2.0,M11.1.0
USER=brian
USERNAME=brian
WORKDIR=/home/BRIAN
Variants
{
"american": "#@$",
"local": "#@$",
"qsysNameRegex": {}
}
For reference, this might be an EBCDIC->UTF8 issue and not nessecerily something going wrong with VS Code.
x05 is a non-printable character by the looks: https://kadler.io/ebcdic/ibm-037/
For sure non-printable. x'05' is a tab.
Just weird that it seems to change the value when saving.
When I see it I drop all the characters before the actual text and use spaces to line things back up.
When you copy/paste from ACS's "Run SQL Scripts", there may be tab characters in the code. ☹ (especially if you generated the source from Schemas)
As a workaround, you just need to find tab characters and replace them with spaces after pasting into VS Code.
But it would be nice if there was an option to convert tabs to spaces when saving to a member.
When you copy/paste from ACS's "Run SQL Scripts", there may be tab characters in the code. ☹ (especially if you generated the source from Schemas)
As a workaround, you just need to find tab characters and replace them with spaces after pasting into VS Code.
But it would be nice if there was an option to convert tabs to spaces when saving to a member.
Maybe this extension could suit your need: https://marketplace.visualstudio.com/items?itemName=redlin.remove-tabs-on-save&ssr=false