When is encoding being relevant in Java? -


this might bit beginner question it's relevant considering debbuging encoding in java: at point encoding being relevant string object?

consider have string object want save file. string object using sort of encoding should manipulate or encoding informed me when create stream of bytes save?

the same applies importing: when open file , it's bytes, assume there's no encoding @ hand, bytes. when parse bytes string, got use encoding understand characters they. after parse bytes, string (in memory) has sort of meta information encoding or being handled jvm?

this vital considering i'm having file import/export issues , got understand @ point should worry getting right encoding.

hope explained doubt well, , thank in advance!

java strings not have explicit encoding information. don't know came from, , don't know going. java strings stored internally utf-16.

you (optionally) specify encoding use whenever want turn string sequence of bytes (e.g., save file), or when want turn sequence of bytes (e.g., read file) string.


Comments