I’ve run into trouble loading UTF-8 text for a test onTextData module. . And then trying to print it. In a spring app it’s loading the files correctly. Any ideas.
Its a problem for Japanese, Chinese and Russian
In Wowza it’s gibberish which possibly explains why it’s gibberish in webvtt output in HLS.
Text like this
Вот гораздо более длинный второй субтитр, который должен заполнить большую часть экрана.
Shows up as this in the console and log
Line: ??? ??? ??? ??? ??? ???, ??? ??? ??? ??? ??? ???. ru
I have set encoding to UTF-8 in the tune config
<VMOption>-Djava.net.preferIPv4Stack=true -DFile.Encoding=UTF-8</VMOption>
The code to load content as utf8
String textFile = SystemUtils.expandEnvironmentVariables(textFileStr, pathMap);
//getLogger().info("FILE: " + textFile);
onTextDataList = new ArrayList<OnTextData>();
File textFileObj = new File(textFile);
BufferedReader inf = null;
if (textFileObj.exists())
{
//inf = new BufferedReader(new FileReader(textFileObj, ));
inf = new BufferedReader(
new InputStreamReader(new FileInputStream(textFileObj), "UTF-8"));