Back to my Julia Unicode gripe

Concerning this unicode string “日本語”

Julia tells me it has a length of 3. This initially led to my indexing problems. Because visually they’re 3 characters. So for example I would try and reference the above 2nd character as one greater than the previous byte. I probably would have figured out what was going on sooner had Julia given me the correct length. I feel the length statement is a bug, because it returns the wrong value for code points greater than 127.

Go on the other hand correctly tells me the above string, has a length of 9.

Leave a comment

Your email address will not be published. Required fields are marked *