Skip to content

Conversation

yutaro-sakamoto
Copy link
Contributor

@yutaro-sakamoto yutaro-sakamoto commented May 7, 2025

This pull request fixes the following bugs related to non-ASCII characters.

  • The older version does not convert in external items and external file descriptors into another valid character in Java.
  • The older version converts BC in external file descriptors into invalid characters.

Addition of a new test case:

  • Added a new test in tests/misc.src/fd-external.at to verify the handling of external file descriptors with non-ASCII characters in field names.

@yutaro-sakamoto yutaro-sakamoto requested a review from Copilot May 7, 2025 07:47
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This pull request addresses bugs related to non-ASCII character handling in external items and file handlers by replacing manual string conversion loops with dedicated helper functions. Key changes include:

  • Replacing manual '-' replacement with a call to strcpy_identifier_cobol_to_java.
  • Removing in-line conversion loops in external file handler routines.
  • Updating external item declarations to use consistent helper functions for identifier conversion.
Files not reviewed (1)
  • tests/misc.src/fd-external.at: Language not supported
Comments suppressed due to low confidence (2)

cobj/codegen.c:2255

  • [nitpick] Verify that passing 'CB_FILE(file)->record->name' directly produces the correct identifier conversion without the previously used manual loop, especially for non-ASCII characters.
joutput(" = CobolExternal.getStorageAddress ("%s", %d);",

cobj/codegen.c:5581

  • [nitpick] Confirm that the combined use of joutput_prefix() and joutput_base(f) fully replicates the intended transformation behavior for external item names, ensuring correct handling of non-ASCII characters.
joutput_prefix();

@yutaro-sakamoto yutaro-sakamoto marked this pull request as ready for review May 7, 2025 08:25
@yutaro-sakamoto yutaro-sakamoto changed the title Fix/file external multi byte Fix non-ASCII characters in external items and external file descriptors May 7, 2025
@yutaro-sakamoto yutaro-sakamoto merged commit b812d71 into opensourcecobol:develop May 29, 2025
293 checks passed
@yutaro-sakamoto yutaro-sakamoto mentioned this pull request May 30, 2025
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.

2 participants