Skip to content

dd: fix ISO-8859-1 case conversion for conv=lcase/ucase#10830

Draft
sylvestre wants to merge 1 commit intouutils:mainfrom
sylvestre:conv-dd
Draft

dd: fix ISO-8859-1 case conversion for conv=lcase/ucase#10830
sylvestre wants to merge 1 commit intouutils:mainfrom
sylvestre:conv-dd

Conversation

@sylvestre
Copy link
Contributor

No description provided.

@collinfunk
Copy link

This assumes that the user is using a ISO-8859-1 locale and not another unibyte locale, e.g., ISO-8859-9.

@ChrisDryden
Copy link
Collaborator

I think we're going to have to build the runtime conversion to use libc to get the locale data for these

  pub fn build_lcase_table() -> ConversionTable {
      let mut table = [0u8; 256];
      for i in 0..256 {
          table[i] = unsafe { libc::tolower(i as libc::c_int) } as u8;
      }
      table
  }

  pub fn build_ucase_table() -> ConversionTable {
      let mut table = [0u8; 256];
      for i in 0..256 {
          table[i] = unsafe { libc::toupper(i as libc::c_int) } as u8;
      }
      table
  }

@github-actions
Copy link

github-actions bot commented Feb 8, 2026

GNU testsuite comparison:

GNU test failed: tests/tail/retry. tests/tail/retry is passing on 'main'. Maybe you have to rebase?
Congrats! The gnu test tests/dd/conv-case is no longer failing!
Congrats! The gnu test tests/tail/tail-n0f is now passing!

@sylvestre sylvestre marked this pull request as draft February 8, 2026 21:58
@sylvestre
Copy link
Contributor Author

testing a different approach

@github-actions
Copy link

github-actions bot commented Feb 8, 2026

GNU testsuite comparison:

Congrats! The gnu test tests/dd/conv-case is no longer failing!
Congrats! The gnu test tests/tail/tail-n0f is now passing!

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