Bug 54931

Summary: Korean is broken by utf8() of String
Product: WebKit Reporter: Gyuyoung Kim <gyuyoung.kim>
Component: JavaScriptCoreAssignee: Nobody <webkit-unassigned>
Status: RESOLVED INVALID    
Severity: Normal    
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: PC   
OS: OS X 10.5   

Gyuyoung Kim
Reported 2011-02-21 20:33:58 PST
korean is broken by utf8(). But, korean is not broken when latin1() is used. It seems to me that this is strange. I test this by below codes. printf("<< korean string test(utf8) : %s \n", String("한글").utf8().data()); printf("<< korean string test(latin1) : %s \n", String("한글").latin1().data()); Does anyone know why korean is broken ? If my test is something wrong, please let me know. Thank you.
Attachments
Gyuyoung Kim
Comment 1 2011-02-21 20:34:49 PST
Result of above test : korean string test(utf8) : íê¸ korean string test(latin1) : 한글
Gyuyoung Kim
Comment 2 2011-02-21 21:31:57 PST
In order to use utf8, we should use fromUTF8() as below, printf("<< korean string test(utf8) : %s \n", (String::fromUTF8("한글")).utf8().data());
Note You need to log in before you can comment on or make changes to this bug.