Ok, so I ended up doing this in my code: String resource = "/exmentis/rules_main.clj"; InputStream is = getClass().getResourceAsStream(resource); String script = ... read in is as a String (like slurp) ... StringReader r = new StringReader(script); clojure.lang.Compiler.load(r, null, resource);
Note I use clojure.lang.Compiler directly because RT has no methods to do what I want. The above works fine, and requires no modifications to the clojure source code. I still would like some 'official' explanation and whether my way of doing things is 'blessed' by M. Hickey and the community. Thanks, Max On Mar 6, 10:21 pm, max3000 <maxime.lar...@gmail.com> wrote: > Some more information: > > In REPL, everything seems fine: > > exmentis=> "ààà" > "ààà" > exmentis=> (def a "àààà") > #'exmentis/a > exmentis=> a > "àààà" > exmentis=> (println a) > àààà > nil > exmentis=> (. System/out println a) > àààà > nil > > However, when I import a Java class: > > public class Application { > public static final String abc = "àààèèè"; > ... > > user=> (import '(application Application)) > nil > user=> Application/abc > "αααΦΦΦ" > > So there is something more to the problem than what I said above... > > I tried (blindly) modifying other places that used UTF8 to use the > default encoding. It didn't change anything. > > My time is up for tonight! ;( Any help would be appreciated. > > Thanks, > > Max > > On Mar 6, 9:34 pm, max3000 <maxime.lar...@gmail.com> wrote: > > > There is definitely a bug. In r994 (Aug 07, 2008) UTF8 encoding was > > added to *in*, *out* and *err*. This messes up the Repl (and the > > Reader in general) as discussed above. > > > Case in point, everything works fine when I go in the code and modify > > RT.java as follows: > > > final static public Var OUT = > > Var.intern(CLOJURE_NS, Symbol.create("*out*"), new > > OutputStreamWriter > > (System.out)); //, UTF8)); > > final static public Var IN = > > Var.intern(CLOJURE_NS, Symbol.create("*in*"), > > new LineNumberingPushbackReader(new > > InputStreamReader > > (System.in))); //, UTF8))); > > (UTF8 commented out) > > > Anyway this could be seen as a bug? Should I report it? Was this made > > like this for a reason? > > > Thanks, > > > Max > > > On Mar 6, 8:03 pm, "rzeze...@gmail.com" <rzeze...@gmail.com> wrote: > > > > On Mar 6, 5:58 pm, max3000 <maxime.lar...@gmail.com> wrote: > > > > > I don't really want to use the SVN version because I'm developing an > > > > application and can really do without the (normal) instabilities that > > > > come with development builds. > > > > FYI, you may want to consider using SVN for now because there have > > > been breaking changes[1] since the last release. The general > > > consensus seems to be that breaking changes are allowed until version > > > 1.0 is released. Most of the commits are bug fixes, so IMO it only > > > gets more stable, not less. > > > > 1:http://clojure.org/lazier --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~----------~----~----~----~------~----~------~--~---