diff options
Diffstat (limited to 'Firestore/Source/Local')
-rw-r--r-- | Firestore/Source/Local/StringView.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Firestore/Source/Local/StringView.h b/Firestore/Source/Local/StringView.h index 799baf8..b81b7b5 100644 --- a/Firestore/Source/Local/StringView.h +++ b/Firestore/Source/Local/StringView.h @@ -46,7 +46,8 @@ class StringView { // Creates a StringView from an NSString. When StringView is an argument type // into which an NSString* is passed, the caller should ensure that the // NSString is retained. - StringView(NSString *str) : data_([str UTF8String]), size_(str.length) { + StringView(NSString *str) + : data_([str UTF8String]), size_([str lengthOfBytesUsingEncoding:NSUTF8StringEncoding]) { } // Creates a StringView from the given char* pointer with an explicit size. |