View Single Post
Old 11-02-2018, 05:38 PM   #49
frostschutz
Linux User
frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.
 
frostschutz's Avatar
 
Posts: 2,279
Karma: 6123806
Join Date: Sep 2010
Location: Heidelberg, Germany
Device: none
Quote:
Originally Posted by sherman View Post
Can you provide a test string, and let me know what characters are missing?
There are no characters missing, it just stops printing early for some reason.

Print '漢' and it shows 漢

Print '漢字' and it still shows 漢

Print '漢字--' and it shows 漢字

Print '漢字----' and it still shows 漢字

Print '漢字-----' it shows 漢字-

It's like it knows it has to show 2 characters, then calls it quits after processing 3 bytes (which is only one character).

漢字 is six bytes and additional - character only shows up when providing a 7 character string. So instead of showing 7 characters as requested, it shows 7 bytes.

And providing 漢字-- (4 characters string) causes the next character to show up (漢字) because the first character only consumed 3 bytes.

So much for my guess without looking at any code at all
frostschutz is offline   Reply With Quote