Sharing with the community: text transcoding libraries

You mentioned only two codepages which are big. If there are indeed only two of them, then I think the simplest option for the users would be to split the lib into three separate libs: common, big codepage 1, and big codepage 2. That way the interface remains straightforward, there’s no need to define a module in the client code, and there will be no duplication, even if multiple client apps use the library.

However, if there are more large codepages, or there’s potential to introduce more of those, then managing one lib per codepage would quickly become too complex for lib maintainers. This is perhaps an opportunity to consider how mix might facilitate such scenario in the future. Perhaps it would be interesting if library authors could provide multiple apps behind a single dependency. That way, the client could specify something like {:some_dep, apps: [:foo, :bar]} to cherry pick the apps it needs from the dependency.

1 Like

I’m very glad I decided to do a search here… remind me to do it more often :smiley: This is incredibly useful information.

I was just looking at Codepagex, and had given up because it wasn’t apparent to me how I could use it to convert cp1252 encoded strings. I guess I could have read the docs a bit better.

It’s a bit of a pity that File.open, File.stream etc. don’t accept encodings like cp1252 but I guess this is where a good library comes in useful.

Excellent writeup @dimitarvp — thanks!

2 Likes