Question

I have a JUnit test that tests adding Strings to a Dictionary custom type. Everything works fine for everyone else on a Linux/Windows machine, however, being the first dev in my shop on a mac, this unit test fails for me. The offending lines are where unicode string literals are used:

    dict.add( "Su字/会意pin", "Su字/会意pin" );
    dict.add( "字/会意", "字/会意" );

Is there a platform-independent way to specify the unicode string? I've tried changing the encoding of the file in Eclipse to UTF-8 instead of the default MacRoman, but the test still fails.

Was it helpful?

Solution

In the flags for the javac compiler, set the -encoding flag, so in your case you'd mark it as

javac -encoding UTF-8
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top