Spring boot JPA broken encoding on database when loaded from data.sql file

As covered in a previous article (here and here) spring-boot is a very useful framework when working on full enabled Spring projects

Recently I wasted some time with yet another encoding problem.. where all my accentuated and special characters where corrupted.

I was using the data.sql convention that states that if a file named data.sql is found in the CLASSPATH spring will use this file to bootstrap the database, my SQL file was properly encoded in UTF-8 as well as my maven-resources-plugin however the data recovered from the database was corrupted (accents and special characters where broken)

After reading a bit the documentation I found out that the source of the problem was at the moment of reading the SQL file that the encoding was causing trouble.. thankfully you can fix this one pretty easlily by changing one property value :


spring-boot has a lot of useful properties that allow you to tune the framework which you can find here

Docker copy images between hosts

Copying docker images (import/export) between hosts Sometimes it's useful to export a local docker image to another host without going...