I have html tags need to be encoded.
I need to encode it to :
I am using escape, but it doesn't work.
the result I got is
I am of course familiar with the
java.net.URLDecoder classes. However, I only need HTML-style encoding. (I don't want
' ' replaced with
'+', etc). I am not aware of any JDK built in class that will do just HTML encoding. Is there one? I am aware of other choices (for example, Jakarta Commons Lang 'StringEscapeUtils', but I don't want to add another external dependency to the project where I need this.
I'm hoping that something has been added to a recent JDK (aka 5 or 6) that will do this that I don't know about. Otherwise I have to roll my own.
What is the easiest way to Html encode in PHP?
I've got encoded html where even tags are encoded into html entities
Some <b> bold </b> text
I'd like to display this as a spanned string in
TextView, however the only way to do it is using
val decoded = Html.fromHtml("").toString() // Some <b>bold</b> textval spanned = Html.fromHtml(decoded)
Is there cleaner way to do this?