Skip to content

Fixed numeral localization in insulin delivery table view#1979

Merged
ps2 merged 1 commit into
LoopKit:devfrom
hannkm:dev
Aug 23, 2023
Merged

Fixed numeral localization in insulin delivery table view#1979
ps2 merged 1 commit into
LoopKit:devfrom
hannkm:dev

Conversation

@hannkm
Copy link
Copy Markdown
Contributor

@hannkm hannkm commented Apr 13, 2023

Fixes #1968
This fixes the issue of symbols appearing instead of numerals. Changes mainly affect Arabic but all numbers should be displayed correctly according to their language now.

@hannkm
Copy link
Copy Markdown
Contributor Author

hannkm commented Apr 13, 2023

This is the issue replicated before the change:
before
This is what it looks now after the fix:
after

@ps2
Copy link
Copy Markdown
Collaborator

ps2 commented Apr 21, 2023

Thanks, can you describe why this is an appropriate change? I don't see it documented that this method expects utf16, and that would be surprising, as usually utf8 is appropriate for these. See this for a possible alternate solution: https://stackoverflow.com/questions/61411944/nsattributedstring-from-utf16-characters-in-uitextview

@ps2
Copy link
Copy Markdown
Collaborator

ps2 commented Apr 21, 2023

Hmm, although further searching brings up this page that does seem to indicate that NSAttributedString might be expecting UTF16. https://samwize.com/2016/05/24/nsattributedstring-html-ios-unicode-encoding/

Would be nice if this was documented. Let me know if you have any other references that can shed some light on what is actually expected by the platform.

@hannkm
Copy link
Copy Markdown
Contributor Author

hannkm commented Apr 21, 2023

Here are some articles I referenced:
https://www.objc.io/issues/9-strings/unicode/ (https://www.objc.io/issues/9-strings/unicode/)
This is the official Apple documents:
https://developer.apple.com/documentation/foundation/nsstring (https://developer.apple.com/documentation/foundation/nsstring)
NSMutableAttributedString requires non-ASCII values to be encoded in UTF-16, and I believe this is the only function (as submitted in this PR) that utilized utf8 encoding for the data entries previously.

Could you clarify where I should document this?

@ps2 ps2 merged commit f3dc84f into LoopKit:dev Aug 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Some Arabic numbers appear in the form of symbols

2 participants