Skip to content

fix(util): map ambiguous UConverter charset aliases#31

Merged
ralflang merged 1 commit into
FRAMEWORK_6_0from
fix/uconverter-charset-aliases
Jul 1, 2026
Merged

fix(util): map ambiguous UConverter charset aliases#31
ralflang merged 1 commit into
FRAMEWORK_6_0from
fix/uconverter-charset-aliases

Conversation

@TDannhauer

Copy link
Copy Markdown
Collaborator

Summary

  • Map ambiguous windows-1252 and tis620 charset aliases to unambiguous ICU names for UConverter

Motivation

HordeString::convertCharset() falls back to UConverter when iconv/mbstring fail. Common mail charset names such as windows-1252 trigger PHP warnings (Ambiguous encoding specified, using ibm-5348_P100-1997) because ICU accepts multiple converters for the same alias.

Changes

  • Extend CharacterSets::$uconverterMap with windows-1252cp1252 and tis620windows-874-2000
  • Add unit tests for the new mappings

Test plan

  • vendor/bin/phpunit --bootstrap vendor/autoload.php vendor/horde/util/test/CharacterSetsTest.php
  • Confirm no UConverter ambiguity warnings for windows-1252 mail parts in production logs

Map windows-1252 and tis620 to unambiguous ICU names so HordeString
charset conversion does not emit PHP warnings.
@TDannhauer TDannhauer requested a review from ralflang July 1, 2026 10:02
@ralflang ralflang merged commit 09567f4 into FRAMEWORK_6_0 Jul 1, 2026
1 check failed
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.

2 participants