From: Ville <vil...@se...> - 2003-08-29 12:44:12
|
On Fri, 2003-08-29 at 15:07, Tomas Gustavsson wrote: > > Even better would be to standardize on a specific encoding (eg. UTF-8) > > in the EJBCA source files :) > > > > I remember seeing varying encodings here and there (mostly in comments) > > which may cause these kinds of problems. > > Do you know of any nice tool that can do this automagically? iconv(1) can, but then one has to know the input encoding... non-careful use could result in a mess. file(1) (maybe with the -i argument) could possibly be used to guess the existing encoding, something like for file in $(find . -name "*.java"); do file -i $file | grep -v ascii done > Hmmm, and > then you have to tech eclipse to use utf8 off-course... Me? :) Seriously, I don't think that would be a problem. > I would like to clean the comments actually to use only plain ascii, > easiest that way. There is one test howver that tests character coding > in DNs, so this can be plain us-ascii unforturnately... You mean cannot be plain us-ascii? \uXXXX escapes to the rescue? http://java.sun.com/docs/books/jls/second_edition/html/lexical.doc.html#95504 There are far too many things that can go wrong with character encodings even though Java is unicode :} Avoiding things that have "...using the platform default charset..." in their docs, eg. String.getBytes() or String(byte[]) without the charset argument is one step towards happiness. |