         }
         return dict
     case SOURCEKITD_VARIANT_TYPE_STRING:
-        return String(UTF8String: sourcekitd_variant_string_get_ptr(sourcekitObject))!
+        return swiftStringFrom(sourcekitd_variant_string_get_ptr(sourcekitObject),
+            length: sourcekitd_variant_string_get_length(sourcekitObject))!
     case SOURCEKITD_VARIANT_TYPE_INT64:
         return sourcekitd_variant_int64_get_value(sourcekitObject)
     case SOURCEKITD_VARIANT_TYPE_BOOL:

        For avoiding those penalty, replaces with enum's rawValue String if defined in SourceKitten.
        That does not cause calling `decomposedStringWithCanonicalMapping`.
        */
        let uidString = sourceKittenRawValueStringFrom(uidString) ?? uidString
        uidStringMap[uid] = uidString
        return uidString
    }

internal func stringForSourceKitUID(uid: sourcekitd_uid_t) -> String? {
    if let string = uidStringMap[uid] {
        return string
    }
    let length = sourcekitd_uid_get_length(uid)
    let pointer = UnsafeMutablePointer<Int8>(sourcekitd_uid_get_string_ptr(uid))
    if let uidString = String(bytesNoCopy: pointer, length: length,
        encoding: NSUTF8StringEncoding, freeWhenDone: false) {
        /*
        `String` created by `String(UTF8String:)` is based on `NSString`.
        `NSString` base `String` has performance penalty on getting `hashValue`.
