we are using the external service to get the data in a CSV format. we are trying to write the data to response so that the csv can be downloadable to client. unfortunately, we are getting the data in the below format.
Amount inc. VAT Balance
£112.83 £0.0
£97.55 £0.0
£15.28 £0.0
we are unable to decode the content. Is there a way to decode £ and display £ in java.
Is there any String Utils available to decode the strings.
Problem:
when we use the getBytes() over string, it tries to decode using the default encoder. once the String is encoded, decoding may not work well if we use the default decoders.
Solution: One
StringUtils of apache will help us in decoding these characters while writing back to the response.
This class is available in
org.apache.commons.codec.binarypackage.Maven 2.0 dependency.
Solution: Two
As per @Joni, Better solution with the standard API: