Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8651169
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T13:59:48+00:00 2026-06-12T13:59:48+00:00

I am writing a Java library for the work with geo-coordinates and the tests

  • 0

I am writing a Java library for the work with geo-coordinates and the tests are implemented with specs2 in Scala. I have many tests that do String comparisons against Strings that include the degree symbol ° (which is a non-ASCII character).

If I run these tests from within IntelliJ, they all pass. They also pass on Travis CI. But if I run sbt test (sbt 11.3) from my Power Shell (Windows x64), all those tests fail and the console shows malformed Strings like shown in the screen shot:

encoding problems

What could be the issue, and how can I fix it? I checked that the files are UTF8-encoded. Also note that changing my Java configuration would not help much, since the tests just have to run if someone else clones the repository (so any solution that solves the problem only on my system isn’t going to help). But I have absolutely no clue what is going wrong here…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T13:59:49+00:00Added an answer on June 12, 2026 at 1:59 pm

    Are your degree symbols encoded directly in the source file?

    If so, I suspect you may have some encoding issues (possibly source files are being interpreted as UTF-8 in IntelliJ and CP1252 when compiled by SBT).

    You could either try changing the degree symbols to '\u00B0' and recompiling, or alternatively you could try setting the source file encoding in SBT with javacOptions ++= Seq("-encoding", "UTF-8").

    FWIW, the compiler (and runtime) uses the default encoding for source (and other) file I/O, unless told otherwise. The default encoding for Windows is CP1252.

    You can tell the javac compiler to use an alternative encoding with the -encoding UTF-8 option, and the runtime with -Dfile.encoding=UTF-8.

    Through Google, I also found some information on how to do this on a system-wide basis here (untested by me).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am currently writing a Java compiler and have implemented section 15.12.2.7. of the
I have a program that I'm writing where I am using another company's library
I'm writing an application that uses the wordpress-java library to display each article in
I am writing a JAVA program for work that at some point needs to
Is there a C or C++ compatible library for reading and writing Java class
I've been writing a platform game in the Slick2D, the Java game library, using
Sometimes while writing Java in Eclipse, I write code that generates warnings. A common
I am writing java code. which will work on windows and linux. some code
What is the best practice for configuring a java class library? At my work,
Can someone tell me if there is a Java library for reading/writing zip files

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.