2007년 06월 19일
루비와 유니코드
일본에서 만든 언어인데 왜 이렇게 유니코드 처리가 빈약한지 모르겠다. 최근 RoR 로 작업하는 일이 있었는데 몇번이나 이놈의 유니코드 처리에 당했다. 레퍼런스를 찾아보면 다음과 같은 아주 고무적인 이야기가 나온다.
버그가 반드시 발생할꺼래요. 너무 고무적인 도움말이군요 :-)
Please note that right now Rails basically knows nothing about Unicode and pretends everything is just bytes. It means that validates_length_of for multibyte characters will trigger errors at the wrong places, various kinds of Unicode whitespaces are not going to get trimmed and sometimes Rails will cut right into your characters. Absolute most of Rails internals makes no notion that multibyte text even exists, Rails just delegates all to the Ruby string handling code (which in current Ruby is all single-byte).
This is being looked at, but in the meantime you use UTF8 encoded strings at your own risk and you can expect (and wil get) bugs and problems :-)
버그가 반드시 발생할꺼래요. 너무 고무적인 도움말이군요 :-)
# by | 2007/06/19 13:14 | 트랙백(1) | 덧글(8)





☞ 내 이글루에 이 글과 관련된 글 쓰기 (트랙백 보내기) [도움말]
제목 : 루비와 유니코드 #2
공식 문서 루비에서 유니코드에 대한 개략적인 이야기 실질적인 해답 아직 이 답이 완전한지는 모르겠지만 당장 사용하는데에 지장이 있는것 같지는 않다. 개인적으로 slice 를 새로 구현하여 사용하고 있다....more
len( u('악플러등장') ) == 5 라서 매우 좋음(???)
이 글이 몇 년전 글인고..ㅠ