I have downloaded the IVR for beginners tutorial and modified it a little to provide voice responses in Russian (java file's encoding is UTF-8):
@Override
protected void doPost(HttpServletRequest servletRequest, HttpServletResponse servletResponse)
throws IOException {
VoiceResponse response = new VoiceResponse.Builder()
.gather(new Gather.Builder()
.action("/menu/show")
.numDigits(1)
.build())
.say(new Say.Builder("Привет")
.voice(Say.Voice.ALICE)
.language(Say.Language.RU_RU)
.build())
.build();
servletResponse.setContentType("text/xml");
try {
servletResponse.getWriter().write(response.toXml());
} catch (TwiMLException e) {
throw new RuntimeException(e);
}
}
However, when I call my number, I hear silence. The console's call log shows question marks instead of Cyrillic characters.

I would appreciate help in solving this problem.
It appears, you "just" had to:
servletResponse.setCharacterEncoding("UTF-8");
..or:
servletResponse.setContentType("text/xml; charset=UTF-8");
...since the default is assumed as ISO-8859-1. (And I am not deep into TwiML or IVR, but this seems to break/fix things (Cyrillic characters) on a basic level.)
refs:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With