views:

367

answers:

1

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.

+3  A: 

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

javac -encoding UTF-8

Check here for a quick explanation from the sun forums.

ReaperUnreal
Worked like a charm! Thanks!
layne