The limitations of Fantom Charsets have been painful in the past and I find myself still working around the same issues today, so I'm just gonna ask straight:
May Fantom Charsets be opened up / exposed to allow custom implementations?
Reading and writing textual data is a vital part of communicating with other external systems and websites, and currently Fantom is limited to just 2 Charsets, UTF-8 or UTF-16. While these do cater for the majority of cases, I do keep finding myself getting caught out by the need for others, such as ISO-8859 and UTF-7.
Writing custom InStream / OutStreams classes is not always an option becuase static code (such as WebUtil.makeContentInStream()) still defer to Fantom Charset internals. So being able to write my own Charsets for interpreting data would be really useful.
Implementation wise, I was thinking it would be nice if Charset implementations could be added in the same way Uri schemes are resolved - via pod index data. That way the static Charset.fromStr() method could look my custom implementations.
brianThu 21 Feb 2019
In the Java runtime it we will support any charset that Java supports. We just wrap the java.nio.charset.Charset API under the covers. So its already pluggable - you just need to find a Java charset lib to drop in. In the older versions I remember that Sun/Oracle put those all into a separate jar that wasn't distributed in the standard runtime.
SlimerDude Thu 21 Feb 2019
The limitations of Fantom Charsets have been painful in the past and I find myself still working around the same issues today, so I'm just gonna ask straight:
May Fantom Charsets be opened up / exposed to allow custom implementations?
Reading and writing textual data is a vital part of communicating with other external systems and websites, and currently Fantom is limited to just 2 Charsets, UTF-8 or UTF-16. While these do cater for the majority of cases, I do keep finding myself getting caught out by the need for others, such as
ISO-8859
andUTF-7
.Writing custom InStream / OutStreams classes is not always an option becuase static code (such as
WebUtil.makeContentInStream()
) still defer to Fantom Charset internals. So being able to write my own Charsets for interpreting data would be really useful.Implementation wise, I was thinking it would be nice if
Charset
implementations could be added in the same wayUri
schemes are resolved - via podindex
data. That way the staticCharset.fromStr()
method could look my custom implementations.brian Thu 21 Feb 2019
In the Java runtime it we will support any charset that Java supports. We just wrap the
java.nio.charset.Charset
API under the covers. So its already pluggable - you just need to find a Java charset lib to drop in. In the older versions I remember that Sun/Oracle put those all into a separate jar that wasn't distributed in the standard runtime.