Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • B Base
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • The Tor Project
  • Network Health
  • Metrics
  • Base
  • Issues
  • #2
Closed
Open
Issue created Aug 30, 2021 by Georg Koppen@gkOwner

website compilation fails with `error: unmappable character for encoding ASCII`

Compiling the metrics website in our reproducible builds system results in:

    [javac] /var/tmp/build/metrics-web-23437dd19d7a/src/main/java/org/torproject/metrics/web/UpdateNews.java:109: error: unmappable character for encoding ASCII
    [javac]             .replaceAll("??", "×")
    [javac]                          ^
    [javac] /var/tmp/build/metrics-web-23437dd19d7a/src/main/java/org/torproject/metrics/web/UpdateNews.java:109: error: unmappable character for encoding ASCII
    [javac]             .replaceAll("??", "×")
    [javac]                           ^
    [javac] /var/tmp/build/metrics-web-23437dd19d7a/src/main/java/org/torproject/metrics/web/UpdateNews.java:110: error: unmappable character for encoding ASCII
    [javac]             .replaceAll("??", "§")
    [javac]                          ^
    [javac] /var/tmp/build/metrics-web-23437dd19d7a/src/main/java/org/torproject/metrics/web/UpdateNews.java:110: error: unmappable character for encoding ASCII
    [javac]             .replaceAll("??", "§")
    [javac]                           ^
    [javac] /var/tmp/build/metrics-web-23437dd19d7a/src/main/java/org/torproject/metrics/web/UpdateNews.java:111: error: unmappable character for encoding ASCII

Looking at the respective code we see:

            .replaceAll("×", "×")
            .replaceAll("§", "§")
            .replaceAll("–", "–")

. So, yes, the ASCII complaint makes sense, in particular if you don't have an UTF-8 environment. This looks pretty similar to https://github.com/mimno/Mallet/issues/159. And, yes, settings the encoding to UTF-8 for javac in the build.xml file in the base project does indeed fix the problem.

I am not sure, though, whether we should do that given that the base project is used by all the other metrics projects, too. However, I think setting the javac encoding is the right fix if one has non-ASCII characters in sources files.

/cc @irl

Assignee
Assign to
Time tracking