classpath-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[cp-patches] Patch: FYI: set encoding for classpath sources


From: Tom Tromey
Subject: [cp-patches] Patch: FYI: set encoding for classpath sources
Date: 23 May 2005 13:26:30 -0600
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50

I'm checking this in.

This sets Classpath's file encoding to "UTF-8".  It updates the
documentation and the Makefile, except for the kjc case, as according
to the web pages I found, kjc doesn't support an encoding option (and
I don't have it installed).  I tested only tested this with gcj.

Tom

Index: ChangeLog
from  Tom Tromey  <address@hidden>

        * doc/hacking.texinfo (Source Code Style Guide): Document UTF-8
        use.
        * lib/Makefile.am (GCJF): New variable.
        (JAVAC): Use it.  Add -encoding option where needed.

Index: doc/hacking.texinfo
===================================================================
RCS file: /cvsroot/classpath/classpath/doc/hacking.texinfo,v
retrieving revision 1.34
diff -u -r1.34 hacking.texinfo
--- doc/hacking.texinfo 27 Mar 2005 15:38:38 -0000 1.34
+++ doc/hacking.texinfo 23 May 2005 19:24:54 -0000
@@ -11,7 +11,7 @@
 This file contains important information you will need to know if you
 are going to hack on the GNU Classpath project code.
 
-Copyright (C) 1998,1999,2000,2001,2002,2003,2004 Free Software Foundation, Inc.
+Copyright (C) 1998,1999,2000,2001,2002,2003,2004, 2005 Free Software 
Foundation, Inc.
 
 @ifnotplaintext
 @dircategory GNU Libraries
@@ -500,6 +500,11 @@
 @itemize
 
 @item
+Java source files in GNU Classpath are encoded using UTF-8.  However,
+ordinarily it is considered best practice to use the ASCII subset of
+UTF-8 and write non-ASCII characters using \u escapes.
+
address@hidden
 If possible, generate specific imports (expand) over java.io.* type
 imports. Order by gnu, java, javax, org. There must be one blank line
 between each group. The imports themselves are ordered alphabetically by
Index: lib/Makefile.am
===================================================================
RCS file: /cvsroot/classpath/classpath/lib/Makefile.am,v
retrieving revision 1.82
diff -u -r1.82 Makefile.am
--- lib/Makefile.am 19 May 2005 06:50:44 -0000 1.82
+++ lib/Makefile.am 23 May 2005 19:24:56 -0000
@@ -12,22 +12,26 @@
 
 # handling source to bytecode compiler programs like gcj, jikes  and kjc
 if FOUND_GCJ
-JAVAC = $(GCJ) --bootclasspath '' --classpath $(compile_classpath) -C -d . 
@classes.standard \
-&& $(GCJ) -Wno-deprecated --bootclasspath '' --classpath $(compile_classpath) 
-C -d . @classes.awt \
-&& $(GCJ) -Wno-deprecated --bootclasspath '' --classpath $(compile_classpath) 
-C -d . @classes.xml \
-&& $(GCJ) -Wno-deprecated --bootclasspath '' --classpath $(compile_classpath) 
-C -d . @classes.standardx
+## Like GCJ but include some common flags.
+GCJF = $(GCJ) -Wno-deprecated --encoding=UTF-8 \
+    --bootclasspath '' --classpath $(compile_classpath)
+JAVAC = $(GCJF) -C -d . @classes.standard \
+&& $(GCJF) -C -d . @classes.awt \
+&& $(GCJF) -C -d . @classes.xml \
+&& $(GCJF) -C -d . @classes.standardx
 else
 if FOUND_JIKES
-JAVAC = $(JIKES) +Pno-shadow +F -bootclasspath '' -extdirs '' -sourcepath '' 
--classpath $(compile_classpath) -d . @classes
+JAVAC = $(JIKES) +Pno-shadow +F -encoding UTF-8 -bootclasspath '' -extdirs '' 
-sourcepath '' --classpath $(compile_classpath) -d . @classes
 else
 if FOUND_KJC
+## FIXME: from what I can tell, kjc does not support a -encoding option.
 JAVAC = $(KJC) -classpath .:$(USER_CLASSLIB) -d . @classes
 else
 if FOUND_GCJX
-JAVAC = $(GCJX) -classpath .:$(USER_CLASSLIB) -d . @classes
+JAVAC = $(GCJX) -encoding UTF-8 -classpath .:$(USER_CLASSLIB) -d . @classes
 else
 if FOUND_ECJ
-JAVAC = $(ECJ) -warn:-deprecation,serial -proceedOnError -bootclasspath '' 
-classpath $(compile_classpath) -d . @classes
+JAVAC = $(ECJ) -encoding UTF-8 -warn:-deprecation,serial -proceedOnError 
-bootclasspath '' -classpath $(compile_classpath) -d . @classes
 endif # FOUND_ECJ
 endif # FOUND_GCJX
 endif # FOUND_KJC




reply via email to

[Prev in Thread] Current Thread [Next in Thread]