Skip to content

refactor: deduplicate charset encode/decode into shared lookup map#213

Open
AnyCPU wants to merge 3 commits intonakagami:masterfrom
AnyCPU:feature/charset_encode_decode_1
Open

refactor: deduplicate charset encode/decode into shared lookup map#213
AnyCPU wants to merge 3 commits intonakagami:masterfrom
AnyCPU:feature/charset_encode_decode_1

Conversation

@AnyCPU
Copy link
Contributor

@AnyCPU AnyCPU commented Mar 10, 2026

this is a little bit of refactoring to make it easier to maintain charsets related stuff.

pros & goals:

  • single source of truth prevents charset bugs from requiring two-file fixes;
  • eliminate duplication of 24 identical charset mappings across two files;
  • reduce ~220 lines of repetitive switch/case boilerplate.

cons:

  • negligible performance difference is dwarfed by encoder allocation and network I/O on every call.

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.

1 participant