Closed purva-dev closed 3 years ago
we have not tested with khmer before as it's not supported on LI. we can try and look through what the issue is, but encourage you to look around as well!
@bkoatz Hello!! Thanks for your reply and now I would like to add here that we figured out the issue is where the string which we are sending in length to create NSRange is type of String
let myNSRange = NSRange(location: aStartIndex, length: aStrName.count)
so we just have to convert the String type to NSString like this
let myNSRange = NSRange(location: aStartIndex, length: (aStrName as NSString).length)
by this we can get the proper length of the string for creating HKWMentionsAttribute
we can also use "unicodeScalars.count" to calculate correct length of string
let myNSRange = NSRange(location: aStartIndex, length: aStrName.unicodeScalars.count)
Happy coding!! 🎉
Please feel free tp put up a PR, including tests :)
I'm facing issue in adding the mention attribute of khmer language text. i.e not able to create a tag for khmer language always returns nil