which obviously does not work.
Actually, that’s how you do it. The only thing that may go wrong is that you implicitly use the standard encoding of the platform, which may vary between systems and may not display all characters in a string.
, , , UTF-8:
byte[] nameByteArray = cityName.getBytes("UTF-8");
String retrievedString = new String(nameByteArray, "UTF-8");