Skip to content

is UTF-8 really necessary as system's default encoding? #55

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
sebix opened this issue May 15, 2025 · 0 comments
Open

is UTF-8 really necessary as system's default encoding? #55

sebix opened this issue May 15, 2025 · 0 comments

Comments

@sebix
Copy link
Contributor

sebix commented May 15, 2025

intelmqcbmail enforces UTF-8 as the system's default encoding as it exists otherwise:

if locale.getpreferredencoding() != 'UTF-8':
log.critical(
'The preferred encoding of your locale setting is not UTF-8'
' but %r. Exiting.', locale.getpreferredencoding())
sys.exit(1)

As the intelmq-mailgen is also used by fody and intelmq-webinput-csv this also requires Apache to run with UTF-8.

All of that regularly causes issues, both on installations and in testing and development environments.

The code was introduced in the very first commit 664c29b and therefore copied from https://github.com/certat/intelmq/blob/a29da5d/intelmq/bin/intelmqcli

I guess it was never checked if this was actually necessary for mailgen. intelmqcli was used on Python 2, so this might just be a leftover from long ago, causing headaches now.

@sebix sebix changed the title is the UTF-8 really necessary as system's default encoding is UTF-8 really necessary as system's default encoding? May 15, 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

No branches or pull requests

1 participant