1
I have an application using spring boot + oracle (via Tomcat datasource). Using spring-data, a simple query in a table returns encoding problem characters.
This same application, in a very specific situation, I create a direct connection (without datasource) with JDBC and run a query in the same table. But in this case, there is no problem with encoding.
Obs.: Before I thought it would just be a problem with the front-end (some JS component), but checking the HTTP Response by the browser, the data is already in problem in the first case, but not in the second.
I’m sorry if this is a duplicate question, but I couldn’t find anything similar. I know there are a lot of issues with oracle+java+charset, but my problem differs from the others I found.
Hello, Igor. You have set up Spring Boot or some filter in your application to force encoding
UTF-8
in the application? Have any encoding settings in the URL your connection to the database? Can you debug the application and see if the data is already recovered with problems? Also check that the HTTP request has some encoding defined in the response. Unfortunately there are several variables that need to be analyzed. If you can check the above points and add more information to your question, we may help you more.– utluiz
@utluiz, thank you so much for the answer. I didn’t set anything specific in Spring or the connection URL. As in an external client environment, I will not debug yet, but it will be my next attempt. As for HTTP, by checking by Sponse in the browser (F12 - Chrome), json already returns with error in requests via datasource and normal in requests via jdbc.
– Igor Veloso
I put some encoding check tips in the answer because it is a common problem. If you find the cause, add an answer yourself.
– utluiz