might also have some other special charsNote that above string its not double quotes.I want to display the String as it is, but for some reason its not processing and i am n" name="description" /> might also have some other special charsNote that above string its not double quotes.I want to display the String as it is, but for some reason its not processing and i am n" />
69725

Encoding Special Characters in String

Question:

I have a String with some special characters like this one.

"45” £800 77” " - > might also have some other special chars

Note that above string its not double quotes.

I want to display the String as it is, but for some reason its not processing and i am not able to proceed further.

What is the best way to encode this ?

I have tried the below :

String out = null; try { out = new String(s.getBytes("UTF-8"), "ISO-8859-1"); } catch (java.io.UnsupportedEncodingException e) { return null; } return out;

But it adds some special symbols to the specials chars.

I am trying to add this string in paypal payment screen , where we display item name.

Answer1:

try this, it may helps you,

tv.settext(Html.fromHtml("Your Text"));

Answer2:

have a look at something like <a href="https://commons.apache.org/proper/commons-lang/javadocs/api-2.6/org/apache/commons/lang/StringEscapeUtils.html" rel="nofollow">StringEscapeUtils.escapeJava</a> from Apache Commons

Recommend

  • How can I use special characters in angular directives attributes?
  • Convert hex to utf in Python
  • IllegalArgumentException caught when parsing URL with JSON String
  • Get or convert Week of year to ISO week
  • Retrieving a contacts notes
  • Special chars in Amazon S3 keys?
  • Encode Byte array to JPEG image in Objective-C
  • css font-size and line-height not matching the baseline
  • C++11 variable size POD struct
  • Send the string to its hex equivalent
  • Xamarin PCLCrypto SHA256 give different hash
  • Graceful pod termination
  • insert a picture into database(sqlite) with java code. what should i do?
  • Getting error java.io.FileNotFoundException (log4j log file) at the time of publish project on cloud
  • Serve file to user over http via php
  • How do you create a Fuseki SPARQL server using the Apache Jena Java API?
  • Python PIL to extract number from image
  • How can I include If-None-Match header in HttpRequestMessage
  • joining two bezier curves
  • Optimizing the print function in Matlab
  • Security issues with PHP's Readfile method
  • Stop Bash Script if Hive Fails
  • Android - Material Design - NavigationView - How to put vertical scroll?
  • Converting a WriteableBitmap image ToArray in UWP
  • Jquery UI tool tip close icon
  • Reading JSON from a file using C++ REST SDK (Casablanca)
  • Why value captured by reference in lambda is broken? [duplicate]
  • Encrypt data by using a public key in c# and decrypt data by using a private key in php
  • jQuery show() function is not executed in Safari if submit handler returns true
  • Cross-Platform Protobuf Serialization
  • javascript inside java/jsp code
  • SSO with signing and signature validation doesn't work
  • How to format a variable of double type
  • Linker errors when using intrinsic function via function pointer
  • Windows forms listbox.selecteditem displaying “System.Data.DataRowView” instead of actual value
  • coudnt use logback because of log4j
  • LevelDB C iterator
  • JaxB to read class hierarchy
  • costura.fody for a dll that references another dll
  • How can i traverse a binary tree from right to left in java?