I try to write a program which will take as an input some text and then the name of the target encoding (ASCII
, UTF-8
, etc.).
Is there any way in Java to write something like this?
String encodedText = String.encode(text, encoding);
Thanks for any suggestions!