1
0
Fork
You've already forked supports-unicode
0

Ignore case when detecting UTF-8 locales. #1

Merged
olson-sean-k merged 1 commit from cmp into main 2021年09月27日 06:17:26 +02:00
olson-sean-k commented 2021年09月27日 05:44:05 +02:00 (Migrated from github.com)
Copy link

I noticed on an Arch Linux installation that miette always used an ASCII character set when printing reports despite the system and terminal emulator supporting Unicode. Upon further inspection, it looks like supports-unicode looks for a case sensitive UTF8 or UTF-8 suffix in locale environment variables, but casing of these values differs between Unix and Linux distributions.

This change performs a case-insensitive comparison by converting the text to uppercase first. Please take a look! Thanks!

I noticed on an Arch Linux installation that `miette` always used an ASCII character set when printing reports despite the system and terminal emulator supporting Unicode. Upon further inspection, it looks like `supports-unicode` looks for a case sensitive `UTF8` or `UTF-8` suffix in locale environment variables, but casing of these values differs between Unix and Linux distributions. This change performs a case-insensitive comparison by converting the text to uppercase first. Please take a look! Thanks!
zkat left a comment
Copy link

Looks good to me! And nice catch!

Thanks for the contrib :)

Looks good to me! And nice catch! Thanks for the contrib :)
Owner
Copy link

Released as v1.0.2

Doing cargo update -p supports-unicode should pick it up.

Released as v1.0.2 Doing `cargo update -p supports-unicode` should pick it up.
Sign in to join this conversation.
No reviewers
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
zkat/supports-unicode!1
Reference in a new issue
zkat/supports-unicode
No description provided.
Delete branch "cmp"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?