Fixing the Issue of Separated Voiced Marks in Folder Names on Mac When Outputting from Python
Python
2022-09-19 07:31 (4 years ago)

When trying to output directory names on a Mac
プ ロシ゛ ェクト
If it ends up looking like this, you can fix it by using
import unicodedata
unicodedata.normalize('NFC', folder_name)
You can correct it with the built-in unicodedata module.
This process is called converting from NFD normalization to NFC normalization of Unicode.
Reference: Handling Unicode normalization NFC/NFD strings in Python - forest book
Please rate this article (No signup or login required)
Currently unrated
Related posts
[Outdated] Using Selenium Remote (Selenium Grid) with browser_use
Obtain HttpOnly=True Session Cookies from Services Logged in via Browser-Use
Fix: Python 3.13 SSL error 'Basic Constraints of CA cert not marked critical' (VERIFY_X509_STRICT)
Template Code for Thread Parallelism and Process Parallelism in Python
The author runs the application development company Cyberneura.
We look forward to discussing your development needs.
We look forward to discussing your development needs.