Adding a good reference in case someone needs it: https://www.baeldung.com/java-string-length-vs-getbytes-length