Issue #5390 has been updated by Aaron Patterson.


菴?篋????????????c??????????????????????

YAML ??????<?ゃ??????若??????????? UTF8, UTF16LE, ??? UTF16BE ???帥?泣????若???????障????????Psych ????????? String ????????若?鴻????????????絖???潟?若????? UTF8 ????????????障?????

箴?鐚? https://gist.github.com/1902995

?????<?ゃ???篏睡????????翫??????????<?ゃ????絖?箴???篁ヤ???? UTF8 ???UTF16LE ??? UTF16BE??????ゃ??推戎???純?с?????

箴?鐚?https://gist.github.com/1903026
----------------------------------------
Bug #5390: YAML.load ??????罩c????f????с?????????潟?潟?若????c?潟?違???絖?????????????篁??????????障??
https://bugs.ruby-lang.org/issues/5390

Author: yu nobuoka
Status: Assigned
Priority: Normal
Assignee: Aaron Patterson
Category: 
Target version: 2.0.0
ruby -v: ruby 1.9.2p290 (2011-07-09 revision 32553) [x86_64-linux]


[[ruby-list:48419]] ???????井?宴????с?????????????????????荅宴??????????障????????с????違??????怨???????障?????

YAML.load ???????????????茖????????????????????潟?若?????菴純??????????????c?????с?????????????????荀?????????????筝??????????????絖????????潟?潟?若????c?潟?違??羂??????????????若?鴻????????????????????????障????? ?????????????Shift_JIS ???????????潟?潟?若????c?潟?違???絖????????????罩c?????????若?鴻?с????障????????

 --- source code ---
 # coding: Shift_JIS
 require "yaml"
 text = '[ "???" ]' # Shift_JIS ??? '???' ??? 2 ?????ゃ?????????????鴻?????激?ャ???????????ゃ?????
 str = YAML.load( text ).first # ????主?榊??

 --- output ---
 /home/nobuoka/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/syck.rb:135:in `load': syntax error on line 0, col 9: `' (ArgumentError)
 	from /home/nobuoka/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/syck.rb:135:in `load'
 	from yaml_cp932.rb:4:in `<main>'

Shift_JIS ????絖??????с????祉???????翫??????紊???榊??????????????若?鴻???????????с??Shift_JIS ????絖???????篏帥?c????????翫?????????莎激???????醇?с?????若?吟?若??茯?茘??????ャ??????????????????????????障????? ?????c?????????????????違???????篁ヤ????????????????????????????眼???????鴻?????????с??????с??????????????

*UTF-8 (UTF-16 ???鐚?) 篁ュ??????潟?潟?若????c?潟?違???絖???????羝<??????????翫??????紊??????榊???????????
*UTF-8 篁ュ??????潟?潟?若????c?潟?違???絖???????羝<??????????翫???????????????? UTF-8 ????????????????????蚊?????
*YAML ??茹?????????с??潟?潟?若????c?潟?違??????????????????????????Shift_JIS ????с??罩c????f????с??????????????????



-- 
http://bugs.ruby-lang.org/