[PR #18] [MERGED] Fix truncation code to handle emojis with a actual width greater than one character. Example: 🎧 #30

Closed
opened 2026-02-27 20:07:48 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/misiektoja/spotify_monitor/pull/18
Author: @tomballgithub
Created: 7/8/2025
Status: Merged
Merged: 7/9/2025
Merged by: @misiektoja

Base: devHead: truncate_fix


📝 Commits (2)

  • ef283ce Fix truncation code to handle emojis with a actual width greater than one character. Example:
  • 9aefccb Instantiate wcwidth

📊 Changes

2 files changed (+17 additions, -4 deletions)

View changed files

📝 requirements.txt (+1 -0)
📝 spotify_monitor.py (+16 -4)

📄 Description

I noticed today that the truncation code doesn't cover the case when some emojis take up two character positions (they are double-wide). An example is the following, which was in the title of a playlist in my log: 🎧

This code does a character-by-character analysis and accounts for this.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/misiektoja/spotify_monitor/pull/18 **Author:** [@tomballgithub](https://github.com/tomballgithub) **Created:** 7/8/2025 **Status:** ✅ Merged **Merged:** 7/9/2025 **Merged by:** [@misiektoja](https://github.com/misiektoja) **Base:** `dev` ← **Head:** `truncate_fix` --- ### 📝 Commits (2) - [`ef283ce`](https://github.com/misiektoja/spotify_monitor/commit/ef283cebb40a7cde93ee7003109a8c33faa74d23) Fix truncation code to handle emojis with a actual width greater than one character. Example: - [`9aefccb`](https://github.com/misiektoja/spotify_monitor/commit/9aefccbd1eb37c48ea70c6bcb622c8b431d9b682) Instantiate wcwidth ### 📊 Changes **2 files changed** (+17 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `requirements.txt` (+1 -0) 📝 `spotify_monitor.py` (+16 -4) </details> ### 📄 Description I noticed today that the truncation code doesn't cover the case when some emojis take up two character positions (they are double-wide). An example is the following, which was in the title of a playlist in my log: 🎧 This code does a character-by-character analysis and accounts for this. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-27 20:07:48 +03:00
Sign in to join this conversation.
No labels
Stale
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/spotify_monitor#30
No description provided.