Skip to content

Commit 45aa2bb

Browse files
authored
Fix regex interpolation search for emoji strings (#32)
1 parent 849db4c commit 45aa2bb

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

Sources/Shark/LocalizationEnumBuilder.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,8 @@ private enum LocalizationValue: Comparable {
8181

8282
private static func interpolationTypes(forValue value: String) throws -> [InterpolationType] {
8383
let regex = try NSRegularExpression(pattern: "%([0-9]*.[0-9]*(d|i|u|f|ld)|(\\d\\$)?@|d|i|u|f|ld)", options: [])
84-
85-
let results = regex.matches(in: value, options: [], range: NSRange(location: 0, length: value.count))
84+
85+
let results = regex.matches(in: value, options: [], range: NSRange(location: 0, length: value.utf16.count))
8686
return results.map { (value as NSString).substring(with: $0.range) }.map(InterpolationType.init)
8787
}
8888
}

0 commit comments

Comments
 (0)