Skip to content

Commit 97dbfaf

Browse files
committed
Make the locale info dumping Java code Python3-aware
1 parent e61a8fd commit 97dbfaf

2 files changed

Lines changed: 9 additions & 5 deletions

File tree

do3

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,7 @@ rm -f *.bak
2323
cd ..
2424
cd ..
2525

26-
sed 's/^PYTHON=python$/PYTHON=python3.2/' makefile > tmp
27-
mv tmp makefile
26+
sed -i '' 's/^PYTHON=python$/PYTHON=python3.2/' makefile
27+
sed -i '' 's/python3 = false/python3 = true/' DumpLocale.java
2828

29-
make geodata
30-
make metadata
29+
make geodata metadata locale

python/DumpLocale.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,15 @@
99
class DumpLocale {
1010
private static final char SINGLE_QUOTE = 39;
1111
private static final char[] hexChar = {'0','1','2','3','4','5','6','7','8','9','a','b','c','d','e','f'};
12+
private static boolean python3 = false;
1213

1314
/* Print a Unicode name suitably escaped */
1415
private static void printName(String name) {
15-
System.out.print("u'");
16+
if (python3) {
17+
System.out.print("'");
18+
} else {
19+
System.out.print("u'");
20+
}
1621
// Need to escape unicode data
1722
for (int ii=0; ii<name.length(); ii++) {
1823
char c = name.charAt(ii);

0 commit comments

Comments
 (0)