Skip to content
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

Perl spits out warning about locales #73

Open
MikeFultonDev opened this issue Nov 1, 2023 · 3 comments
Open

Perl spits out warning about locales #73

MikeFultonDev opened this issue Nov 1, 2023 · 3 comments
Labels
bug Something isn't working

Comments

@MikeFultonDev
Copy link
Collaborator

The texinfo test suite has a number of failures due to a message about locales.
See: zopencommunity/texinfoport#17 for details.

@IgorTodorovskiIBM not sure if this is related to recent changes in Perl or not - perhaps an env var isn't set right now - but this
could always have been there (new tests now running).

@MikeFultonDev
Copy link
Collaborator Author

MikeFultonDev commented Nov 2, 2023

Digging in a little bit, it appears to be because 'ispunct' is giving the wrong answers for the UTF8 locale. Here's a testcase that shows when the test is built in 'ASCII-mode' ispunct gets the wrong answer for the UTF-8 locale and when built in 'EBCDIC-mode' the setlocale to the UTF8 locale fails.

test>clang -fzos-le-char-mode=ascii punctest.c

test>./a.out

C: ispunct('#'):256
UTF-8: ispunct('#'):0

test>clang punctest.c
test>./a.out

C: ispunct('#'):16
Unable to set locale to UTF-8

test>cat punctest.c

#include <ctype.h>
#include <stdio.h>
#include <locale.h>

int main() {
  printf("C: ispunct('#'):%d\n", ispunct((unsigned char) ('#')));
  if (!setlocale(LC_ALL, "en_US.UTF-8")) {
    fprintf(stderr, "Unable to set locale to UTF-8\n");
    return 8;
  }
  printf("UTF-8: ispunct('#'):%d\n", ispunct((unsigned char) ('#')));
  return 0;
}

@MikeFultonDev
Copy link
Collaborator Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant