your 'utf8' is a utf8 string.
so you need conversion to ansi string or unicode string.
like this..
::OutputDebugStringW(*utf8, CP_UTF8));
2012년 8월 29일 수요일 오후 4시 23분 10초 UTC+9, amourfou 님의 말:
>
> In the following JS script
>
> -------------------------------------------------
> function Test()
> {
> return "가나다라마바사";
> }
> -------------------------------------------------
>
> I called the function "Test" in C++ code and assigned the result to
> v8::String::Utf8Value.
>
> The C++ Code is the following.
>
> Handle<Value> hValue = String::New("Test");
> Local<Value> event = context->Global()->Get(hValue);
> Handle<Value> result;
> if (event->IsFunction())
> {
> Handle<Function> function = Handle<Function>::Cast(event);
>
> if (!function.IsEmpty())
> {
> TryCatch try_catch;
> result = function->Call(context->Global(), 0, NULL);
>
> String::Utf8Value utf8(result);
>
> printf("%s\n", *utf8);
> }
> }
>
> I compiled this code with VC++ 2010.
>
> I expected the result, *utf8, is "가나다라마바사" but it was broken string.
>
> Also, the v8_shell sample program has the same result. Attatched file is
> the result of v8_shell.
>
> I guess that all program on Windows Korean ver. will have the abnormal
> result.
>
> Please let me know how to get the normal result.
>
> Thx~
>
--
v8-users mailing list
[email protected]
http://groups.google.com/group/v8-users