From 143df2319014f3dcdaa67177f739c3863533bcbd Mon Sep 17 00:00:00 2001 From: Hiroshi Nishio Date: Mon, 23 Feb 2026 16:46:37 -0800 Subject: [PATCH] Normalize display names with NFKC and dot-to-space replacement Replaces the conditional title-casing (only when all-lower or all-upper) with unconditional NFKC normalization, dot replacement, and title-casing to handle Unicode fancy chars, dotted names, and mixed-case consistently. --- services/github/users/get_user_public_email.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/services/github/users/get_user_public_email.py b/services/github/users/get_user_public_email.py index c96d0782..27b01caf 100644 --- a/services/github/users/get_user_public_email.py +++ b/services/github/users/get_user_public_email.py @@ -1,3 +1,4 @@ +import unicodedata from dataclasses import dataclass import requests @@ -33,8 +34,7 @@ def get_user_public_info(username: str, token: str): email = user_data.get("email") name: str = user_data.get("name") or "" - # Title-case if all lowercase or all uppercase (e.g., "wes nishio" -> "Wes Nishio", "HIROSHI" -> "Hiroshi") - # Cross-ref: website/app/api/auth/[...nextauth]/route.ts - if name == name.lower() or name == name.upper(): - name = name.title() + # Normalize: strip Unicode fancy chars + title-case every word + # Cross-ref: website/utils/normalize-display-name.ts + name = unicodedata.normalize("NFKC", name).replace(".", " ").title() return UserPublicInfo(email=email, display_name=name)