Convert String to ByteArray with different encode using kotlin and java but got error result

Seems like a source encoding issue. My guess is that you have written both source files in UTF-8 but compiled the Java program using a different encoding.