# Custom string encodings

**URL:** https://community.haxe.org/t/custom-string-encodings/4775
**Category:** Haxe
**Created:** [February 20, 2026, 12:11am UTC](https://community.haxe.org/t/custom-string-encodings/4775 "2026-02-20T00:11:00Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![davidgiven](https://community.haxe.org/user_avatar/community.haxe.org/davidgiven/32/1326_2.png) [@davidgiven](https://community.haxe.org/u/davidgiven)
#### Post date: [February 20, 2026, 12:11am UTC](https://community.haxe.org/t/custom-string-encodings/4775/1 "2026-02-20T00:11:00Z")

</div>

I’m trying to do some email processing. It’s a quagmire of weird encoding types…

I find I have the requirement to write my own specific string encoding routines. It’d be really nice if I could just create my own `Encoding` objects to encapsulate this, so I can pass these into `Bytes.ofString` and `Bytes.getString`. However, it looks like an `Encoding` is a closed enum and all the actual encoding/decoding stuff is hidden away inside.

Can this be done? Or alternatively, are there any existing libraries that provide equivalent functionality?

Thanks!
