From 7ab8f8b27e178d00b4ec5b810522d3ea2fac7c74 Mon Sep 17 00:00:00 2001 From: mark-nicepants <62654433+mark-nicepants@users.noreply.github.com> Date: Sat, 15 Nov 2025 20:34:44 +0100 Subject: [PATCH] =?UTF-8?q?fix:=20Error=20400=20when=20using=20appBundleIn?= =?UTF-8?q?fo=20with=20non=20ascii=20character=20(like=20=C3=AB=20or=20?= =?UTF-8?q?=C3=A4)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Source/Pipeline/Policies/UserAgentPolicy.swift | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/sdk/core/AzureCore/Source/Pipeline/Policies/UserAgentPolicy.swift b/sdk/core/AzureCore/Source/Pipeline/Policies/UserAgentPolicy.swift index fc576633c..7338e91ca 100644 --- a/sdk/core/AzureCore/Source/Pipeline/Policies/UserAgentPolicy.swift +++ b/sdk/core/AzureCore/Source/Pipeline/Policies/UserAgentPolicy.swift @@ -80,6 +80,13 @@ public class UserAgentPolicy: PipelineStage { if applicationId.rangeOfCharacter(from: .whitespacesAndNewlines) != nil { applicationId = applicationId.components(separatedBy: .whitespacesAndNewlines).joined() } + + // Remove diacritics (accents/umlauts) and convert to ASCII + applicationId = applicationId.folding(options: .diacriticInsensitive, locale: .current) + + // Remove non-ASCII characters + applicationId = String(applicationId.unicodeScalars.filter { $0.isASCII }) + // From the design guidelines, applicationId must not be more than 24 characters in length if applicationId.count > 24 { applicationId = String(applicationId.prefix(24))