spring data jpa utf-8 encoding not working
Try
spring.datasource.url = jdbc:mysql://localhost:3306/gehive?useUnicode=yes&characterEncoding=UTF-8
It seems issue is due to missing "-".
Reference:-
https://forum.hibernate.org/viewtopic.php?f=1&t=1037497&view=next
Spring Data JPA - Encoding UTF-8 doesn't work
&
should not be added to the connection string. Spring ensures the url is encoded when the actual connection is made.
Also the correct param to be set when the connection is made is useUnicode=true
JPA utf-8 characters not persisted
use the character encoding in the property of persistence.xml file
<property name="javax.persistence.jdbc.url"
value="jdbc:mysql://localhost:3306/blogdatabase?useUnicode=yes&characterEncoding=UTF-8"/>
Spring-Boot, Can't save unicode string in MySql using spring-data JPA
In your /etc/mysql/my.cnf
file change the following.
[mysql]
default-character-set=utf8
[mysqld]
character-set-server=utf8
Streaming Data using Spring Data JPA gives Encoding Error
I solved my problem using environmental variable:
java -Dfile.encoding=utf8 -jar jar-path
Encoding issue with data.sql in Spring Boot with Maven
The encoding problem seems to come from the surefire plugin. I added the following lines in the <plugins/>
of my pom.xml:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<argLine>-Dfile.encoding=UTF-8</argLine>
</configuration>
</plugin>
Problem solved: It seems that surefire launched the tests in its own JVM, with a ISO-8859-1 encoding.
The fixed project is available on GitHub
Related Topics
How to Subtract One Day from Current Date Then Convert to String in Hive
Spring Data JPA Utf-8 Encoding Not Working
Splitting String into Multiple Rows in Oracle
Concatenate With String But Exclude When Null
Way to Find Data of a SQL Table With Same Status for Consecutive 3 Days
Error 1067 (42000): Invalid Default Value for 'Created_At'
Find Employee Name Who Is Having Highest Salary in Given Month in SQL
Use Multiple Conflict_Target in on Conflict Clause
How to Get Total Count Value Each Day Upto 5 Days
Calculating Percent Change Between Two Rows
Database Table With Million of Rows
Convert Julian Date to Yyyy-Mm-Dd
Repeat Each Value in SQL Table N Times With 1:N in Different Column
Hive Explode List from Json-String
Converting to Timestamp With Time Zone Failed on Athena
Multiple Insert With Same Column (Ms Access)