From f10cc946674b1a17600ee27f3fead238aa53f73c Mon Sep 17 00:00:00 2001 From: Robin Leroy Date: Wed, 11 Dec 2024 11:26:55 +0100 Subject: [PATCH] . not /, and use a class in the right package --- .../main/java/org/unicode/text/UCD/UseTransliterator.java | 2 +- .../main/java/org/unicode/text/utility/UnicodeDataFile.java | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/unicodetools/src/main/java/org/unicode/text/UCD/UseTransliterator.java b/unicodetools/src/main/java/org/unicode/text/UCD/UseTransliterator.java index 0cf56d8b7..3321216ae 100644 --- a/unicodetools/src/main/java/org/unicode/text/UCD/UseTransliterator.java +++ b/unicodetools/src/main/java/org/unicode/text/UCD/UseTransliterator.java @@ -14,7 +14,7 @@ public static void main(String[] args) throws IOException { final File f2 = new File("org/unicode/text/UCD/"); System.out.println(f2.getAbsolutePath()); TransliteratorUtilities.registerTransliteratorFromFile( - UseTransliterator.class.getResource("/").getPath(), "any-temp"); + UseTransliterator.class.getResource(".").getPath(), "any-temp"); final Transliterator t = Transliterator.getInstance("any-temp"); final File f = new File(filename); final String fileContents = diff --git a/unicodetools/src/main/java/org/unicode/text/utility/UnicodeDataFile.java b/unicodetools/src/main/java/org/unicode/text/utility/UnicodeDataFile.java index 6489c5db0..f8c630c22 100644 --- a/unicodetools/src/main/java/org/unicode/text/utility/UnicodeDataFile.java +++ b/unicodetools/src/main/java/org/unicode/text/utility/UnicodeDataFile.java @@ -4,6 +4,7 @@ import java.io.IOException; import java.io.PrintWriter; import org.unicode.text.UCD.Default; +import org.unicode.text.UCD.MakeUnicodeFiles; import org.unicode.text.utility.Utility.RuntimeIOException; public class UnicodeDataFile { @@ -70,7 +71,10 @@ private UnicodeDataFile(String directory, String filename, boolean isHTML) throw } try { Utility.appendFile( - getClass().getResource("/").getPath() + filename + "Header" + fileType, + MakeUnicodeFiles.class.getResource(".").getPath() + + filename + + "Header" + + fileType, Utility.UTF8_UNIX, out); } catch (final RuntimeIOException e) {