I am using the classic XML as my web service back end for my two apps, one written in pure Android, the other in Flutter (iOS). The Flutter version with it's unescape() function builtin has no problems deciphering the hidden newlines in the XML. However, with many years of history and thousands of programmers and solutions around, I am not able to show new lines in my text in the app with the widely available solutions like
str.replaceAll("\\r\\n", \r\n");
str.replaceAll("\\n", "\n");
Also, because I am getting unicode in string, I tried this too to show in HTML
str.replace("\r\n", "<br />");
str.replace(" ", " ");
txtView.setText(Html.fromHtml(str));
None of these work, and I am plagued with this problem for a while now. Any experts here that can help me out?