<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On 6 July 2016 at 09:07, Thomas Raehalme <span dir="ltr">&lt;<a href="mailto:thomas.raehalme@aitiofinland.com" target="_blank">thomas.raehalme@aitiofinland.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">I didn&#39;t say using ISO-8859-1 with .properties was elegant, just the way it is :-)</div></blockquote><div><br></div><div>The fact that it&#39;s the default doesn&#39;t mean it has to be the only way ;)</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><br></div><div>For XML files UTF-8 is the default in the specification: <a href="https://www.w3.org/TR/REC-xml/#sec-guessing" target="_blank">https://www.w3.org/TR/REC-xml/#sec-guessing</a></div><div>Maintaining XML files is not fun either, but it does solve the encoding issue.<br></div><div><br></div><div>Best regards,</div><div>Thomas</div><div><div class="h5"><div><br><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jul 6, 2016 at 9:43 AM, Stian Thorgersen <span dir="ltr">&lt;<a href="mailto:sthorger@redhat.com" target="_blank">sthorger@redhat.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div dir="ltr">Actually, just thought of a con for encoding header in properties file. IDEs would not honor it and would in most cases believe the file is iso-8859-1.</div><div><div><div class="gmail_extra"><br><div class="gmail_quote">On 6 July 2016 at 08:41, Stian Thorgersen <span dir="ltr">&lt;<a href="mailto:sthorger@redhat.com" target="_blank">sthorger@redhat.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div dir="ltr">Java properties file does by default use iso-8859-1, but that&#39;s far from elegant for some languages. I don&#39;t see any issues with supporting utf-8 with a header like I suggested. It would be fairly easy to implement. Java does use utf-8 by default for XML property files, but I don&#39;t think that&#39;s a very nice format to edit the messages in.</div><div><div><div class="gmail_extra"><br><div class="gmail_quote">On 6 July 2016 at 08:32, Thomas Raehalme <span dir="ltr">&lt;<a href="mailto:thomas.raehalme@aitiofinland.com" target="_blank">thomas.raehalme@aitiofinland.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div dir="ltr">Please correct me if I am wrong, but I have been under the impression that Java .properties files should always use encoding ISO-8859-1. Characters not present in ISO-8859-1 can be written in \uxxxx. Won&#39;t it make things confusing to developers if another encoding is used here instead?<div><br></div><div><a href="https://docs.oracle.com/javase/8/docs/api/java/util/Properties.html#load-java.io.InputStream-" target="_blank">https://docs.oracle.com/javase/8/docs/api/java/util/Properties.html#load-java.io.InputStream-</a><br><div><a href="https://docs.oracle.com/javase/8/docs/api/java/util/Properties.html#store-java.io.OutputStream-java.lang.String-" target="_blank">https://docs.oracle.com/javase/8/docs/api/java/util/Properties.html#store-java.io.OutputStream-java.lang.String-</a></div><div><br></div><div>If alternate encodings are desired how about supporting the XML format of Properties?</div><div><br></div><div>Best regards,</div><div>Thomas</div><div><div><div><br><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jul 6, 2016 at 9:04 AM, Stian Thorgersen <span dir="ltr">&lt;<a href="mailto:sthorger@redhat.com" target="_blank">sthorger@redhat.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div dir="ltr">Both iso-8859-1 and utf-8 message bundles should be able to co-exist. <div><br><div>We can allow specifying the encoding in a comment on the first line like this:</div><div><br></div><div># encoding=utf-8</div><div>key=value</div><div><br></div><div><div># encoding=iso-8859-1</div><div>key=value</div></div></div><div><br></div><div>If the first line in the file doesn&#39;t contain the comment with the encoding then we should default to iso-8859-1 for backwards compatibility</div></div><div><div><div class="gmail_extra"><br><div class="gmail_quote">On 5 July 2016 at 09:49, Hiroyuki Wada <span dir="ltr">&lt;<a href="mailto:wadahiro@gmail.com" target="_blank">wadahiro@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">Thanks for your comment.<br>
<span><br>
&gt; If we want to change to utf-8 we&#39;d still need to support iso.. for backwards compatibility.<br>
<br>
</span>If we change to UTF-8, we can still read unicode codepoint like &#39;\u00e8&#39;.<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>
&#39;à&#39; so I agree to support ISO-8859-1 for backwards compatibility.<br>
To support this, I think we can add a property like &quot;messageEncoding&quot;<br>
in keycloak-server.json as below. Is it a good idea?<br>
<br>
    &quot;theme&quot;: {<br>
        &quot;staticMaxAge&quot;: 2592000,<br>
        &quot;cacheTemplates&quot;: true,<br>
        &quot;cacheThemes&quot;: true,<br>
        &quot;messageEncoding&quot;: &quot;ISO-8859-1&quot;,<br>
        &quot;folder&quot;: {<br>
          &quot;dir&quot;: &quot;${jboss.home.dir}/themes&quot;<br>
        }<br>
    },<br>
<br>
Regards,<br>
<div><div><br>
On Mon, Jul 4, 2016 at 10:33 PM, Stian Thorgersen &lt;<a href="mailto:sthorger@redhat.com" target="_blank">sthorger@redhat.com</a>&gt; wrote:<br>
&gt; We have in the past discussed this and decided to stick with ISO-8859-1.<br>
&gt; That was probably not the best idea though. If we want to change to utf-8<br>
&gt; we&#39;d still need to support iso.. for backwards compatibility.<br>
&gt;<br>
&gt; On 4 July 2016 at 14:37, Bruno Oliveira &lt;<a href="mailto:bruno@abstractj.org" target="_blank">bruno@abstractj.org</a>&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt; It makes sense, maybe file a Jira associated with:<br>
&gt;&gt; <a href="https://issues.jboss.org/browse/KEYCLOAK-3259" rel="noreferrer" target="_blank">https://issues.jboss.org/browse/KEYCLOAK-3259</a> ?<br>
&gt;&gt;<br>
&gt;&gt; On 2016-07-04, Hiroyuki Wada wrote:<br>
&gt;&gt; &gt; Hello all,<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; I am trying to translate all base theme messages to my country<br>
&gt;&gt; &gt; language, Japanese. And I&#39;d like to contribute them. Before that work,<br>
&gt;&gt; &gt; I&#39;d like to propose about the files encoding.<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Currently, the message files (*.properties) are loaded with ISO-8859-1<br>
&gt;&gt; &gt; encoding. Therefore, it is necessary to convert the files by<br>
&gt;&gt; &gt; &#39;native2ascii&#39; command beforehand. However we can directly read the<br>
&gt;&gt; &gt; property files with UTF-8 encoding in java 1.6 or later because<br>
&gt;&gt; &gt; &#39;java.util.Properties#load(java.io.Reader)&#39; method was introduced as<br>
&gt;&gt; &gt; below.<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; <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>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; So, my proposal is supporting the message files with UTF-8 encoding. I<br>
&gt;&gt; &gt; believe that it&#39;s very developers/customers friendly. In addition, we<br>
&gt;&gt; &gt; can easily review the translated messages on the github pull request<br>
&gt;&gt; &gt; view and so on. What do you think?<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; If it&#39;s ok, I&#39;ll create a JIRA issue and create a pull request.<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Regards,<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; --<br>
&gt;&gt; &gt; Hiroyuki Wada,<br>
&gt;&gt; &gt; Developer,<br>
&gt;&gt; &gt; Nomura Research Institute, Ltd.<br>
&gt;&gt; &gt; _______________________________________________<br>
&gt;&gt; &gt; keycloak-dev mailing list<br>
&gt;&gt; &gt; <a href="mailto:keycloak-dev@lists.jboss.org" target="_blank">keycloak-dev@lists.jboss.org</a><br>
&gt;&gt; &gt; <a href="https://lists.jboss.org/mailman/listinfo/keycloak-dev" rel="noreferrer" target="_blank">https://lists.jboss.org/mailman/listinfo/keycloak-dev</a><br>
&gt;&gt;<br>
&gt;&gt; --<br>
&gt;&gt;<br>
&gt;&gt; abstractj<br>
&gt;&gt; PGP: 0x84DC9914<br>
&gt;&gt; _______________________________________________<br>
&gt;&gt; keycloak-dev mailing list<br>
&gt;&gt; <a href="mailto:keycloak-dev@lists.jboss.org" target="_blank">keycloak-dev@lists.jboss.org</a><br>
&gt;&gt; <a href="https://lists.jboss.org/mailman/listinfo/keycloak-dev" rel="noreferrer" target="_blank">https://lists.jboss.org/mailman/listinfo/keycloak-dev</a><br>
&gt;<br>
&gt;<br>
</div></div></blockquote></div><br></div>
</div></div><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></blockquote></div><br><br>
</div></div></div></div></div></div>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div>
</div></div></blockquote></div><br>
</div></div></div></div></div>
</blockquote></div><br></div></div>