On 1 July 2010 19:46, Peter Schuller <peter.schul...@infidyne.com> wrote: >> I'm on Snow Leopard. I think there's something wrong with Terminal > > So my guess is that for some reason the terminal is not using the same > encoding as whatever is expected by Java (presumably Java looks at > LANG and friends).
Just for comparison, on Linux with a UTF8 locale, Python gives similar results: $ python Python 2.6.2 (release26-maint, Apr 19 2009, 01:56:41) [GCC 4.3.3] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> "車馬象士將士象馬車" '\xe8\xbb\x8a\xe9\xa6\xac\xe8\xb1\xa1\xe5\xa3\xab\xe5\xb0\x87\xe5\xa3\xab\xe8\xb1\xa1\xe9\xa6\xac\xe8\xbb\x8a' >>> len("車馬象士將士象馬車") 27 >>> u"車馬象士將士象馬車" u'\u8eca\u99ac\u8c61\u58eb\u5c07\u58eb\u8c61\u99ac\u8eca' >>> len(u"車馬象士將士象馬車") 9 >>> len("車馬象士將士象馬車".decode("utf8")) 9 >>> -- Michael Wood <esiot...@gmail.com> -- 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 Note that posts from new members are moderated - please be patient with your first post. 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