B
B
bigMOTOR2015-09-28 19:49:53
Java
bigMOTOR, 2015-09-28 19:49:53

Why do my two services, communicating via http, spoil the Russian language?

Good afternoon!
There are two services written by me in Java+Spring. Fasting on a single AWS instance. One service is waiting for another POST.
And so, when it sends POST service receives "?" instead of Russian letters. Messages leave normally with letters judging by logs.
POST sender server log:

2:41:44.179 [task-scheduler-9] INFO - Your SnsNotification is: {"topic": "arn:aws:sns:us-east-xxxxxxx",
"message": "Внимание сообщение!.",
"badge": 1,
"sound": "bingbong.aiff",
"isDebug": false}
12:41:46.613 [task-scheduler-9] INFO - Server successfully answered with response code: 200 - SNS message was successfully published.

Server log received POST:
12:41:45.022 [http-nio-8080-exec-1] INFO - publishToSnsTopic has been called for 
topicARN:arn:aws:sns:us-east-xxxxxxx with 
messageBody:???????? ?????????? ?????!, 
badgeNum:1,
soundName:bingbong.aiff 
and isDebug:false

Why is that? What is the problem? As I understand it, it's not about locales, otherwise it would be ???? appeared at the first service.
At the same time, when I send a message from the IntelliJ IDEA tools, the Russian language passes.
Thank you in advance!

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Valera Programmer, 2015-09-29
@bigMOTOR

Add to the method responsible for sending: produces = "text/plain;charset=UTF-8";
Example:
@RequestMapping(value = "/demo/send-text", produces = "text/plain;charset=UTF-8")

N
Nazar Mokrinsky, 2015-09-28
@nazarpc

There is only one answer - incorrect encoding. It is desirable that both sites work in utf8, otherwise you need to remember to convert the encoding correctly.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question