<div dir="ltr">No, we don't want the theme properties (and other properties files) to be utf-8. They should stick with the default encoding used by Java properties files.<div><br></div><div>Messages are a special case, which is why we accepted it for them.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On 14 July 2016 at 13:29, Hiroyuki Wada <span dir="ltr"><<a href="mailto:wadahiro@gmail.com" target="_blank">wadahiro@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Thank you for merging the pull request. Could I send a pull request converting to UTF-8 encoding against the theme properties?<br><br><div class="gmail_quote"><div dir="ltr">2016年7月7日(木) 21:39 Hiroyuki Wada <<a href="mailto:wadahiro@gmail.com" target="_blank">wadahiro@gmail.com</a>>:<br></div><div><div class="h5"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Yes. I will send a pull request later!<br><br><div class="gmail_quote"><div dir="ltr">2016年7月7日(木) 21:20 Stian Thorgersen <<a href="mailto:sthorger@redhat.com" target="_blank">sthorger@redhat.com</a>>:<br></div></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Are you doing a PR as well?</div><div class="gmail_extra"><br><div class="gmail_quote">On 7 July 2016 at 12:33, Hiroyuki Wada <span dir="ltr"><<a href="mailto:wadahiro@gmail.com" target="_blank">wadahiro@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Ok. I created a JIRA issue.<div><a href="https://issues.jboss.org/browse/KEYCLOAK-3278" target="_blank">https://issues.jboss.org/browse/KEYCLOAK-3278</a><br><br><div class="gmail_quote"><div dir="ltr">2016年7月6日(水) 19:36 Stian Thorgersen <<a href="mailto:sthorger@redhat.com" target="_blank">sthorger@redhat.com</a>>:<br></div><div><div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Let's go for it. Please create a JIRA and send PR. Please just use "# encoding: utf-8" and not "<span style="font-size:12.8px"># -*- coding: utf-8 -*-". The latter is just weird if you ask me.</span><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">Thomas: It's optional, defaults to iso-8859-1 and the header will clearly state that a file uses a different encoding, so I disagree that there will be any confusion.</span></div></div><div class="gmail_extra"><br><div class="gmail_quote">On 6 July 2016 at 12:30, Hiroyuki Wada <span dir="ltr"><<a href="mailto:wadahiro@gmail.com" target="_blank">wadahiro@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span>On Wed, Jul 6, 2016 at 6:53 PM, Thomas Raehalme<br>
<<a href="mailto:thomas.raehalme@aitiofinland.com" target="_blank">thomas.raehalme@aitiofinland.com</a>> wrote:<br>
> From the javadoc of java.util.ResourceBundle the encoding for .properties is<br>
> still expected to be ISO-8859-1:<br>
><br>
>> Constructing a PropertyResourceBundle instance from an InputStream<br>
>> requires that the input stream be encoded in ISO-8859-1. In that case,<br>
>> characters that cannot be represented in ISO-8859-1 encoding must be<br>
>> represented by Unicode Escapes as defined in section 3.3 of The Java™<br>
>> Language Specification whereas the other constructor which takes a Reader<br>
>> does not have that limitation.<br>
<br>
</span>It's a case of using constructor which takes an InputStream.<br>
It says we can use any encoding when we use the other constructor<br>
which takes a Reader.<br>
<br>
I understand your concern. So what do you think supporting utf-8 with<br>
a header like Stian suggested?<br>
I think it can avoid confusion because the encoding is noted in the<br>
file itself...<br>
<br>
Regards,<br>
<div><div><br>
> <a href="https://docs.oracle.com/javase/8/docs/api/java/util/PropertyResourceBundle.html" rel="noreferrer" target="_blank">https://docs.oracle.com/javase/8/docs/api/java/util/PropertyResourceBundle.html</a><br>
><br>
> I understand that Spring allows one to read .properties using any encoding,<br>
> but you need to specify the encoding in Spring configuration external to the<br>
> .properties file.<br>
><br>
> In my opinion it would cause unnecessary confusion amongst developers to use<br>
> any other encoding than the one defined by the official documentation for<br>
> Properties.<br>
><br>
> Best regards,<br>
> Thomas<br>
><br>
><br>
> On Wed, Jul 6, 2016 at 12:40 PM, Hiroyuki Wada <<a href="mailto:wadahiro@gmail.com" target="_blank">wadahiro@gmail.com</a>> wrote:<br>
>><br>
>> I think it was true before Java 1.6 because Java standard library<br>
>> (java.util.ResourceBundle or java.util.Properties) only supported<br>
>> ISO-8859-1 encoding file.<br>
>> But they support any encoding after Java 1.6. There are some<br>
>> frameworks which can read .properties with any encoding. For example,<br>
>> Spring Framework can read .properties with any encoding. I think it's<br>
>> very useful to read UTF-8 directly for multibyte language country.<br>
>><br>
>> On Wed, Jul 6, 2016 at 3:32 PM, Thomas Raehalme<br>
>> <<a href="mailto:thomas.raehalme@aitiofinland.com" target="_blank">thomas.raehalme@aitiofinland.com</a>> wrote:<br>
>> > Please correct me if I am wrong, but I have been under the impression<br>
>> > that<br>
>> > Java .properties files should always use encoding ISO-8859-1. Characters<br>
>> > not<br>
>> > present in ISO-8859-1 can be written in \uxxxx. Won't it make things<br>
>> > confusing to developers if another encoding is used here instead?<br>
>> ><br>
>> ><br>
>> > <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Properties.html#load-java.io.InputStream-" rel="noreferrer" target="_blank">https://docs.oracle.com/javase/8/docs/api/java/util/Properties.html#load-java.io.InputStream-</a><br>
>> ><br>
>> > <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Properties.html#store-java.io.OutputStream-java.lang.String-" rel="noreferrer" target="_blank">https://docs.oracle.com/javase/8/docs/api/java/util/Properties.html#store-java.io.OutputStream-java.lang.String-</a><br>
>> ><br>
>> > If alternate encodings are desired how about supporting the XML format<br>
>> > of<br>
>> > Properties?<br>
>> ><br>
>> > Best regards,<br>
>> > Thomas<br>
>> ><br>
>> ><br>
>> > On Wed, Jul 6, 2016 at 9:04 AM, Stian Thorgersen <<a href="mailto:sthorger@redhat.com" target="_blank">sthorger@redhat.com</a>><br>
>> > wrote:<br>
>> >><br>
>> >> Both iso-8859-1 and utf-8 message bundles should be able to co-exist.<br>
>> >><br>
>> >> We can allow specifying the encoding in a comment on the first line<br>
>> >> like<br>
>> >> this:<br>
>> >><br>
>> >> # encoding=utf-8<br>
>> >> key=value<br>
>> >><br>
>> >> # encoding=iso-8859-1<br>
>> >> key=value<br>
>> >><br>
>> >> If the first line in the file doesn't contain the comment with the<br>
>> >> encoding then we should default to iso-8859-1 for backwards<br>
>> >> compatibility<br>
>> >><br>
>> >> On 5 July 2016 at 09:49, Hiroyuki Wada <<a href="mailto:wadahiro@gmail.com" target="_blank">wadahiro@gmail.com</a>> wrote:<br>
>> >>><br>
>> >>> Thanks for your comment.<br>
>> >>><br>
>> >>> > If we want to change to utf-8 we'd still need to support iso.. for<br>
>> >>> > backwards compatibility.<br>
>> >>><br>
>> >>> If we change to UTF-8, we can still read unicode codepoint like<br>
>> >>> '\u00e8'.<br>
>> >>> There is an incompatibility when non-ascii characters are used in<br>
>> >>> message properties.<br>
>> >>> The non-ascii characters are 0xA0 - 0xFF codes (please refer codepage<br>
>> >>> layout: <a href="https://en.wikipedia.org/wiki/ISO/IEC_8859-1#Codepage_layout" rel="noreferrer" target="_blank">https://en.wikipedia.org/wiki/ISO/IEC_8859-1#Codepage_layout</a> )<br>
>> >>><br>
>> >>> I think the non-ascii characters might be used in French messages like<br>
>> >>> 'à' so I agree to support ISO-8859-1 for backwards compatibility.<br>
>> >>> To support this, I think we can add a property like "messageEncoding"<br>
>> >>> in keycloak-server.json as below. Is it a good idea?<br>
>> >>><br>
>> >>> "theme": {<br>
>> >>> "staticMaxAge": 2592000,<br>
>> >>> "cacheTemplates": true,<br>
>> >>> "cacheThemes": true,<br>
>> >>> "messageEncoding": "ISO-8859-1",<br>
>> >>> "folder": {<br>
>> >>> "dir": "${jboss.home.dir}/themes"<br>
>> >>> }<br>
>> >>> },<br>
>> >>><br>
>> >>> Regards,<br>
>> >>><br>
>> >>> On Mon, Jul 4, 2016 at 10:33 PM, Stian Thorgersen<br>
>> >>> <<a href="mailto:sthorger@redhat.com" target="_blank">sthorger@redhat.com</a>><br>
>> >>> wrote:<br>
>> >>> > We have in the past discussed this and decided to stick with<br>
>> >>> > ISO-8859-1.<br>
>> >>> > That was probably not the best idea though. If we want to change to<br>
>> >>> > utf-8<br>
>> >>> > we'd still need to support iso.. for backwards compatibility.<br>
>> >>> ><br>
>> >>> > On 4 July 2016 at 14:37, Bruno Oliveira <<a href="mailto:bruno@abstractj.org" target="_blank">bruno@abstractj.org</a>> wrote:<br>
>> >>> >><br>
>> >>> >> It makes sense, maybe file a Jira associated with:<br>
>> >>> >> <a href="https://issues.jboss.org/browse/KEYCLOAK-3259" rel="noreferrer" target="_blank">https://issues.jboss.org/browse/KEYCLOAK-3259</a> ?<br>
>> >>> >><br>
>> >>> >> On 2016-07-04, Hiroyuki Wada wrote:<br>
>> >>> >> > Hello all,<br>
>> >>> >> ><br>
>> >>> >> > I am trying to translate all base theme messages to my country<br>
>> >>> >> > language, Japanese. And I'd like to contribute them. Before that<br>
>> >>> >> > work,<br>
>> >>> >> > I'd like to propose about the files encoding.<br>
>> >>> >> ><br>
>> >>> >> > Currently, the message files (*.properties) are loaded with<br>
>> >>> >> > ISO-8859-1<br>
>> >>> >> > encoding. Therefore, it is necessary to convert the files by<br>
>> >>> >> > 'native2ascii' command beforehand. However we can directly read<br>
>> >>> >> > the<br>
>> >>> >> > property files with UTF-8 encoding in java 1.6 or later because<br>
>> >>> >> > 'java.util.Properties#load(java.io.Reader)' method was introduced<br>
>> >>> >> > as<br>
>> >>> >> > below.<br>
>> >>> >> ><br>
>> >>> >> ><br>
>> >>> >> ><br>
>> >>> >> ><br>
>> >>> >> > <a href="http://docs.oracle.com/javase/6/docs/api/java/util/Properties.html#load(java.io.Reader)" rel="noreferrer" target="_blank">http://docs.oracle.com/javase/6/docs/api/java/util/Properties.html#load(java.io.Reader)</a><br>
>> >>> >> ><br>
>> >>> >> > So, my proposal is supporting the message files with UTF-8<br>
>> >>> >> > encoding.<br>
>> >>> >> > I<br>
>> >>> >> > believe that it's very developers/customers friendly. In<br>
>> >>> >> > addition,<br>
>> >>> >> > we<br>
>> >>> >> > can easily review the translated messages on the github pull<br>
>> >>> >> > request<br>
>> >>> >> > view and so on. What do you think?<br>
>> >>> >> ><br>
>> >>> >> > If it's ok, I'll create a JIRA issue and create a pull request.<br>
>> >>> >> ><br>
>> >>> >> > Regards,<br>
>> >>> >> ><br>
>> >>> >> > --<br>
>> >>> >> > Hiroyuki Wada,<br>
>> >>> >> > Developer,<br>
>> >>> >> > Nomura Research Institute, Ltd.<br>
>> >>> >> > _______________________________________________<br>
>> >>> >> > keycloak-dev mailing list<br>
>> >>> >> > <a href="mailto:keycloak-dev@lists.jboss.org" target="_blank">keycloak-dev@lists.jboss.org</a><br>
>> >>> >> > <a href="https://lists.jboss.org/mailman/listinfo/keycloak-dev" rel="noreferrer" target="_blank">https://lists.jboss.org/mailman/listinfo/keycloak-dev</a><br>
>> >>> >><br>
>> >>> >> --<br>
>> >>> >><br>
>> >>> >> abstractj<br>
>> >>> >> PGP: 0x84DC9914<br>
>> >>> >> _______________________________________________<br>
>> >>> >> keycloak-dev mailing list<br>
>> >>> >> <a href="mailto:keycloak-dev@lists.jboss.org" target="_blank">keycloak-dev@lists.jboss.org</a><br>
>> >>> >> <a href="https://lists.jboss.org/mailman/listinfo/keycloak-dev" rel="noreferrer" target="_blank">https://lists.jboss.org/mailman/listinfo/keycloak-dev</a><br>
>> >>> ><br>
>> >>> ><br>
>> >><br>
>> >><br>
>> >><br>
>> >> _______________________________________________<br>
>> >> keycloak-dev mailing list<br>
>> >> <a href="mailto:keycloak-dev@lists.jboss.org" target="_blank">keycloak-dev@lists.jboss.org</a><br>
>> >> <a href="https://lists.jboss.org/mailman/listinfo/keycloak-dev" rel="noreferrer" target="_blank">https://lists.jboss.org/mailman/listinfo/keycloak-dev</a><br>
>> ><br>
>> ><br>
>> ><br>
><br>
><br>
><br>
><br>
<br>
_______________________________________________<br>
keycloak-dev mailing list<br>
<a href="mailto:keycloak-dev@lists.jboss.org" target="_blank">keycloak-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/keycloak-dev" rel="noreferrer" target="_blank">https://lists.jboss.org/mailman/listinfo/keycloak-dev</a></div></div></blockquote></div><br></div>
</blockquote></div></div></div></div>
</blockquote></div><br></div>
</blockquote></div></blockquote></div></div></div>
</blockquote></div><br></div>