freemarker-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Dekany <ddek...@apache.org>
Subject Re: [FM3] Rename encoding to charset, use Charset instead of String
Date Tue, 21 Mar 2017 18:39:09 GMT
Tuesday, March 21, 2017, 3:31:56 PM, Woonsan Ko wrote:

> +1 on both.

Furthermore, as the "encoding" parameter of
getTemplate/#include/#import was removed in FM3, the
locale-to-encoding map (`Configuration.setEncoding(Locale, String)`)
was also removed. So now it should just be `charset`, not
`defaultCharset` (similarly as we have Template.charset). However,
that name is still pretty bad, as it doesn't tell if the charset of
what it is. It's the charset of the the template file when we read it.
So, maybe, it should be "sourceCharset"?

> Woonsan
>
> On Sun, Mar 19, 2017 at 2:22 PM, Daniel Dekany <ddekany@freemail.hu> wrote:
>> We have this retro terminology where instead of charset we say
>> encoding. (I understand that encoding has a wider meaning, but we only
>> intend to support encoding/decoding via a charset.) So I think
>> cfg.setDefaultEncoding and <#ftl encoding=...> and such should be
>> renamed to cfg.setDefaultCharset and <#ftl charset=...>.
>>
>> Also, in the Java API-s we should use Charset instead of a String
>> (java.nio.charset.Charset didn't exist when FM 2.3 was created).
>>
>> --
>> Thanks,
>>  Daniel Dekany
>>
>

-- 
Thanks,
 Daniel Dekany


Mime
View raw message