0
I have a Spring JPA application with an H2 database.
I created a data.sql file with some INSERTS
and this script is running normally on application startup, but the special characters are being corrupted when inserted in the tables.
I added in the application.properties
the property below but the error still persists
spring.datasource.sqlScriptEncoding=UTF-8
The data is getting in the table this way:
ID NOME
1 Afeganist�o
2 �frica do Sul
Same script run manually shows no problem on write.
I’ll leave the link of a project I did, take a look at the 4 files and see if it helps you; link_do_project
– Edward Ramos
Thanks, I took a look at your files but it didn’t solve my problem.
– Cíntia Neves
Just to wrap up the topic... I found the reason for the error, the settings were ok, the problem occurred because I was generating the data.sql file in another editor and adding the folder. When opening the file at eclipse I noticed that the data had been corrupted by adding the file to the project folder and not during the recording. I solved the problem by saving the file directly in eclipse.
– Cíntia Neves
Put what happened as your answer, so other users can see and get an idea of what happened :)
– Edward Ramos