diff --git a/CHANGELOG.md b/CHANGELOG.md index 26a69c366..02944f146 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,7 +11,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - File viewer in chats (Image/Animated Image/Video/Texts) with the option to export the file. - Accept/decline CLI commands. -## 5.0.10 - undefined +## 5.0.11 - udnefined + +### Fixed +- Display of non-Ascii avatar + +## 5.0.10 - 2023-02-02 ### Fixed - Remove blank notification when declining incoming call. diff --git a/linphone-app/ui/modules/Linphone/Contact/Avatar.qml b/linphone-app/ui/modules/Linphone/Contact/Avatar.qml index 822f00e55..9fe76041c 100644 --- a/linphone-app/ui/modules/Linphone/Contact/Avatar.qml +++ b/linphone-app/ui/modules/Linphone/Contact/Avatar.qml @@ -33,14 +33,15 @@ Item { } function _computeInitials () { + // Do not use charAt from string because it doesn't support all UTF8 characters. var result = username.match(_initialsRegex) if (!result) { - return username.length > 0 ? username.charAt(0).toUpperCase() : '' + var usernameArray = Array.from(username) + return usernameArray.length > 0 ? usernameArray[0].toUpperCase() : '' } - - return result[1].charAt(0).toUpperCase() + ( - result[2] != null - ? result[2].charAt(0).toUpperCase() + return Array.from(result[1])[0].toUpperCase() + ( + result.length > 1 && result[2].length > 0 + ? Array.from(result[2])[0].toUpperCase() : '' ) }