{"id":6157,"date":"2014-04-13T04:35:33","date_gmt":"2014-04-13T04:35:33","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/04\/13\/enabling-utf-8-encoding-for-clojure-source-files-collection-of-common-programming-errors-2\/"},"modified":"2014-04-13T04:35:33","modified_gmt":"2014-04-13T04:35:33","slug":"enabling-utf-8-encoding-for-clojure-source-files-collection-of-common-programming-errors-2","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/04\/13\/enabling-utf-8-encoding-for-clojure-source-files-collection-of-common-programming-errors-2\/","title":{"rendered":"enabling UTF-8 encoding for clojure source files-Collection of common programming errors"},"content":{"rendered":"<p>\nI&#8217;m working on a project which involves maven, java and clojure. The problem I&#8217;m facing is this, I have some <code>UTF-8<\/code> chars in my clojure source files because of which my source code is not interpreted correctly by the java compiler, I kinda got it working by setting the environment variable <code>JAVA_TOOL_OPTIONS=-Dfile.encoding=UTF8<\/code>, but what I want is to pass this property through MAVEN.<\/p>\n<p>I have already tried setting <code>MAVEN_OPTS=-Dfile.encoding<\/code> but this doesn&#8217;t seem to work.<br \/>\nI have also tried setting configuration for the compiler plugin of maven&#8230; something like this:<\/p>\n<pre><code> \n        -Dfile.encoding=UTF8\n \n<\/code><\/pre>\n<p>This doesn&#8217;t work either.<\/p>\n<p>I&#8217;m I doing something wrong, or is there another way.<\/p>\n<p>thanks,<br \/>\nRD<\/p>\n<p>Ok, Here&#8217;s some more detail. This is my parent pom,<\/p>\n<pre><code>  \n    org.apache.maven.plugins\n    maven-compiler-plugin\n    \n      1.5\n      1.5\n      UTF-8 UTF8\n    \n  \n<\/code><\/pre>\n<p>Nothing interesting in the child&#8217;s pom except&#8230;<\/p>\n<pre><code>\n  \n    src\/main\/clojure\n  \n\n<\/code><\/pre>\n<p>;; clojure code snippet which causes problems<\/p>\n<pre><code>(let [char \"?\"]\n   (not (empty? (filter #(s\/contains? % char) )))\n;; The list is always empty because I never find a match if I do not set the env. variable\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;m working on a project which involves maven, java and clojure. The problem I&#8217;m facing is this, I have some UTF-8 chars in my clojure source files because of which my source code is not interpreted correctly by the java compiler, I kinda got it working by setting the environment variable JAVA_TOOL_OPTIONS=-Dfile.encoding=UTF8, but what I [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-6157","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/6157","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=6157"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/6157\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=6157"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=6157"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=6157"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}