Html.fromHtml()删除回车returs"&安培;#的xD"," \\ n" [英] Html.fromHtml() removes carriage-returs "&#xD", "\n"
问题描述
作为回应,我得到一个字符串,它是Windows .ini文件中的每一对都有&放大器; #xD
这到底是回车在规范的XML。
之后
As a response I am getting a string which is windows .ini file each pair has 
in the end this is the carriage-return in Canonical XML.
After
String ini = Html.fromHtml(response).toString();
INI得到的字符串没有断行,而不是他们的空格。如何保持他们的地方换行符?
ini gets string with no line breaks instead of them white-spaces. How to keep line-breaks on their places?
响应当属
<字符串
的xmlns =http://schemas.microsoft.com/2003/10/Serialization/>&放大器; LT;?XML版本=1.0
encoding=\"utf-8\"?><Profile>[General]
AutoRecoveryConversion=1
UpdateExistingBootScreen=0
EnableTraditionalBL=1....
<string xmlns="http://schemas.microsoft.com/2003/10/Serialization/"><?xml version="1.0" encoding="utf-8"?><Profile>[General]
AutoRecoveryConversion=1
UpdateExistingBootScreen=0
EnableTraditionalBL=1....
和我必须按原样处理它,没有任何变化将会从服务器提供。
and I have to deal with it as is, no change will be provided from server.
推荐答案
如果替换响应字符串&放大器; #xD;以&lt; BR /&GT;输出字符串包含正确的换行符。
If replace in response string "
" with <br /> output string contains proper line breaks.
这篇关于Html.fromHtml()删除回车returs&QUOT;&安培;#的xD&QUOT;,&QUOT; \\ n&QUOT;的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!