I need to find out the length of a string for different character sets in Java. Assuming that I have 160 characters and the ASCII character set, the byte length should be 140. Similarly I need for other character set also.
I may get an input stream in any of the character set, but once received it will be stored in UTF-16 and subsequently I will not be able to get the exact byte length of original character set.