I'm going to split some hairs, because it matters for the topic at hand.
>Unicode of course takes up more space and fills up your buffer sooner. Looks like the jump happens after 8 chars.
It sounds like you are conflating unicode with UTF-8. There is more than one way to represent the unicode code points, and UTF-8 is one of them. Further, it seems like you assume that "unicode characters" have a constant size. This is a potentially dangerous misunderstanding of how UTF-8 works. UTF-8 code points have a variable number of bytes (from one to four bytes, IIRC.) You happen to have copied some code points that take 3 bytes each.
I also used to believe Unicode and UTF-8 were different types of encoding until someone corrected me. I just remembered why I had thought such a thing in the first place:
I think it's supposed to be ありがとう ("arigatou"), which is is Japanese for "thank you" (the informal version). The characters are hiragana.
I have no idea why they left off the う at the end, though, except that it just turns the last o into a long o and many foreign speakers are insensitive to the difference between the two because they sound almost the same.
I don't use it. For Japanese, try Rikaichan (a Firefox translation plugin) which lets you look up unfamiliar kanji without leaving the website. You can also look words up on http://www.alc.co.jp/ but it might be hard to use unless you can read at least basic Japanese.
Cool! Thanks for taking the time to test this - while the idea of testing with unicode chars occurred to me while writing the post, I didn't have time to get to it...
Comments
Unicode of course takes up more space and fills up your buffer sooner. Looks like the jump happens after 8 chars.
Grabbed those unicode chars from http://blog.trydionel.com/2010/03/23/some-unicode-tips-for-r... no clue what that says.I'm going to split some hairs, because it matters for the topic at hand.
>Unicode of course takes up more space and fills up your buffer sooner. Looks like the jump happens after 8 chars.
It sounds like you are conflating unicode with UTF-8. There is more than one way to represent the unicode code points, and UTF-8 is one of them. Further, it seems like you assume that "unicode characters" have a constant size. This is a potentially dangerous misunderstanding of how UTF-8 works. UTF-8 code points have a variable number of bytes (from one to four bytes, IIRC.) You happen to have copied some code points that take 3 bytes each.
The UTF-8 encoding scheme is a great compromise, and the wikipedia article is easy to follow: http://en.wikipedia.org/wiki/UTF-8
I also used to believe Unicode and UTF-8 were different types of encoding until someone corrected me. I just remembered why I had thought such a thing in the first place:
http://msdn.microsoft.com/en-us/library/system.text.encoding...
You and probably everyone else the first time they encounter unicode / UTF-8. I wonder if it's because both terms start with 'U'.
Thanks for correcting my errors.
> no clue what that says.
I think it's supposed to be ありがとう ("arigatou"), which is is Japanese for "thank you" (the informal version). The characters are hiragana.
I have no idea why they left off the う at the end, though, except that it just turns the last o into a long o and many foreign speakers are insensitive to the difference between the two because they sound almost the same.
It's pretty common to leave out the う in informal speech.
I also heart google translate.
http://translate.google.com/#ja|en|%E3%81%82%E3%82%8A%E3%81%...
I don't use it. For Japanese, try Rikaichan (a Firefox translation plugin) which lets you look up unfamiliar kanji without leaving the website. You can also look words up on http://www.alc.co.jp/ but it might be hard to use unless you can read at least basic Japanese.
Yes, hiragana are from an unicode range that encodes to 3 UTF-8 characters each, so ruby appears to use UTF-8. ありがと is "arigato".
You probably mean "three bytes in UTF-8", talking about "UTF-8 characters" is really confusing.
You're absolutely right, I should have said "three bytes" or "three octets".
ありがとう -> thanks, note you are missing the う on the end.
You're welcome.
That's what I get for checking up on my limited unicode knowledge before posting, and then just C&Ping.
Thanks.
Cool! Thanks for taking the time to test this - while the idea of testing with unicode chars occurred to me while writing the post, I didn't have time to get to it...