Display special characters using System.out.println

前端 未结 4 499
不知归路
不知归路 2020-11-29 08:23

I\'m having trouble sending or displaying text with special characters from my webservice to my database. On my eclipse I have set the character encoding to UTF-8 but it sti

4条回答
  •  一向
    一向 (楼主)
    2020-11-29 09:17

    Yeah, its the XXI. century and we're still struggling with things like character encoding...

    My first guess is that either:

    1. your source file encoding might be wrong (do you use build tools like Maven? It might be needed to set the source-encoding there too),
    2. your console encoding might be wrong (are you under Windows? The default command line console is not UTF by default, its local-dependant, but with a small play in the registry you can set its encoding)
    3. your DB encoding might be incorrect (what is the Table encoding, can you check that?)

提交回复
热议问题