Skip to content

Conversation

yuvalnn
Copy link

@yuvalnn yuvalnn commented Aug 2, 2025

Changes

This PR adds configurable Bidi (bi-directional text) support for source members encoded in CCSIDs like 424, 420, and others.

Features

  • New extension settings under "Source Code":

    1. Enable Bidi support for member editing (checkbox).
    2. Bidi-compatible CCSID (number input).
  • Conversion logic only runs when enabled in the settings.

  • Encoding is handled via IFS-based copy to avoid corruption.

  • The implementation is cleanly isolated to avoid side effects.

Note: Bidi support is currently not compatible with "Source Dates" mode.

How to test this PR

  1. Open the extension settings → "Source Code" tab.
  2. Enable Enable Bidi support for member editing.
  3. Set Bidi-compatible CCSID.
  4. Open a source member originally encoded with a Bidi CCSID.
  5. Verify the content is displayed correctly and saved as expected.
  6. Disable the setting and confirm fallback to normal behavior.

Checklist

  • have tested my change
  • have created one or more test cases
  • updated relevant documentation
  • Remove any/all console.logs I added
  • have added myself to the contributors' list in CONTRIBUTING.md

yuvalnn added 4 commits July 25, 2025 19:38
- Added two new extension settings(index.ts):
  1. Enable Bidi conversion
  2. Target CCSID for Bidi conversion

- Modified IBMiContent to apply Bidi-aware conversion logic
  when enabled via user settings, including fallback and error handling.
Extends the Bidi handling to also apply when uploading source members back to the IBM i.
@worksofliam worksofliam self-requested a review August 11, 2025 14:42
@worksofliam
Copy link
Member

@yuvalnn This is look like a good start, but we're going to need some granular tests in encoding.test.ts to make sure this works long term. Can you look into adding some? Let me know if you have any questions. Thanks for your work so far!

- Added BiDi test cases in src/api/tests/suites/encoding.test.ts
- Covers Hebrew (CCSID 424) and Arabic (CCSID 420)
- Includes helper convertToUTF8WithCCSID and edge cases
@yuvalnn
Copy link
Author

yuvalnn commented Aug 16, 2025

@worksofliam I’ve added a new synchronous test suite in encoding.test.ts to cover the BiDi changes, thanks to the work from @Itsanexpriment

The suite includes:
Valid/invalid conversions for CCSID 420 (Arabic) and 424 (Hebrew)
Centralized BidiContents test data object for easier extension
Helper convertToUTF8WithCCSID (similar to runCommandsWithCCSID)

We kept this in a separate suite to avoid interfering with existing async tests.
All tests are passing on my side

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants