Bug 54931 - Korean is broken by utf8() of String
Summary: Korean is broken by utf8() of String
Status: RESOLVED INVALID
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC OS X 10.5
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-02-21 20:33 PST by Gyuyoung Kim
Modified: 2011-02-21 21:32 PST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Gyuyoung Kim 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.
Comment 1 Gyuyoung Kim 2011-02-21 20:34:49 PST
Result of above test :

 korean string test(utf8) : íê¸ 
 korean string test(latin1) : 한글
Comment 2 Gyuyoung Kim 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());