From 5522b9de3b3e12af9290f2481c27230d12219777 Mon Sep 17 00:00:00 2001 From: Kristina Koeva Date: Fri, 25 Sep 2015 14:22:36 +0300 Subject: [PATCH] Support utf8 characters by using StringBuilder instead of WTF::String::format() WTF::String::format() messes up with the utf8 characters. https://bugs.webkit.org/show_bug.cgi?id=37327 --- src/NativeScript/inspector/SourceProviderManager.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/NativeScript/inspector/SourceProviderManager.cpp b/src/NativeScript/inspector/SourceProviderManager.cpp index 77b8a22c3..c5da28322 100644 --- a/src/NativeScript/inspector/SourceProviderManager.cpp +++ b/src/NativeScript/inspector/SourceProviderManager.cpp @@ -15,6 +15,11 @@ RefPtr ResourceManager::addSourceProvider(WTF::String url, } WTF::String ResourceManager::constructFunctionContent(WTF::String moduleBody) { - return String::format("{function anonymous(require, module, exports, __dirname, __filename) { %s \n}}", moduleBody.utf8().data()); + StringBuilder builder; + builder.append("{function anonymous(require, module, exports, __dirname, __filename) {"); + builder.append(moduleBody); + builder.append("\n}}"); + + return builder.toString(); } } \ No newline at end of file