Answer the question
In order to leave comments, you need to log in
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.
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
Answer the question
In order to leave comments, you need to log in
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")
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 questionAsk a Question
731 491 924 answers to any question