This doesn't work. You're comparing byte lengths with string lengths.