Yea, that works. Although the naming would be:
val jsonBytes = ...getBytes("utf-8")