Quantcast
Channel: Active questions tagged utf-8 - Stack Overflow
Viewing all articles
Browse latest Browse all 1053

Issues printing emojis and symbols on Windows Terminal using Java

$
0
0

I'm using JDK 21, that has the file.encoding automatically to UTF-8 but, even adding it explicitly as a command argument, nothing changes. I checked the property in the code and it is indeed UTF-8.

I've set sun.stdout.encoding to UTF-8 manually too. It changes the output, but still unreadable.

Printing the emoji 🤣 on System.out with the sun.stdout the result is -fñú and without it, it just shows a ?

On another post I saw people suggesting to change the terminal code page or use the System.console().writer instead of System.out, but neither worked for me

The source is being encoded with UTF-8 properly too

  • JDK 21
  • Windows 11
  • Windows Terminal - Powershell

Viewing all articles
Browse latest Browse all 1053

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>