Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Fix non-ASCII characters in external items and external file descriptors #629

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from

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

@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
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.

1 participant