Changeset 27746 in webkit for trunk/JavaScriptCore/API
- Timestamp:
- Nov 12, 2007, 11:12:55 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/API/JSStringRef.cpp
r27730 r27746 37 37 #include <kjs/ustring.h> 38 38 #include <kjs/value.h> 39 #include <wtf/unicode/UTF8.h> 39 40 40 41 using namespace KJS; 42 using namespace WTF::Unicode; 41 43 42 44 JSStringRef JSStringCreateWithCharacters(const JSChar* chars, size_t numChars) 43 45 { 44 46 JSLock lock; 45 return toRef(UString(reinterpret_cast<const UChar*>(chars), static_cast<int>(numChars)).rep()->ref());47 return toRef(UString(reinterpret_cast<const KJS::UChar*>(chars), static_cast<int>(numChars)).rep()->ref()); 46 48 } 47 49 … … 49 51 { 50 52 JSLock lock; 51 // FIXME: <rdar://problem/4949018> 52 return toRef(UString(string).rep()->ref()); 53 54 size_t length = strlen(string); 55 Vector< ::UChar, 1024> buffer(length); 56 ::UChar* p = buffer.data(); 57 ConvertUTF8ToUTF16(&string, string + length, &p, p + length, false); 58 59 return toRef(UString(reinterpret_cast<KJS::UChar*>(buffer.data()), p - buffer.data()).rep()->ref()); 53 60 } 54 61
Note:
See TracChangeset
for help on using the changeset viewer.