-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Open
Labels
Pri2design/techdoc-enhancementfeedback is about suggested additions/improvements to the article, but customer is not blockedfeedback is about suggested additions/improvements to the article, but customer is not blockeduwp/prod
Description
Hello,
I am excited about the UTF-8 support. The page mentions "Until recently, Windows has emphasized "Unicode" -W variants over -A APIs." Does this mean the ANSI functions are now preferred over the WCHAR ones? For a new application wanting to support multiple languages, which of calling the UTF-8 APIs or the UTF-16LE ones is recommended? Would it be possible to update the page with the information?
Thank you!
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
- ID: 77a994ff-cdad-3cbc-11c3-626285d3cb7e
- Version Independent ID: 6fcd9265-4bfc-657a-9177-7c958f1b4b06
- Content: Use the Windows UTF-8 code page - Windows apps
- Content Source: hub/apps/design/globalizing/use-utf8-code-page.md
- Product: uwp
- Technology: design
- GitHub Login: @Karl-Bridge-Microsoft
- Microsoft Alias: kbridge
Metadata
Metadata
Assignees
Labels
Pri2design/techdoc-enhancementfeedback is about suggested additions/improvements to the article, but customer is not blockedfeedback is about suggested additions/improvements to the article, but customer is not blockeduwp/prod
Type
Projects
Milestone
Relationships
Development
Select code repository
Activity
actioning GitHub issue (#3307)
Paul-Dempsey commentedon Mar 20, 2023
While UTF-8 now works, and could be convenient for x-platform code, WIndows is still at its base a 16-bit Unicode system and using A APIs always involves a runtime conversion (small but nonzero performance impact). So, depends on your codebase and specific app requirements. UTF-8 is still relatively new, and there are likely interesting edge cases and potential interop issues that could be problematic. (e.g. low-level file system edge cases with nonconforming Unicode sequences.)
jaigak commentedon Oct 15, 2023
Another thing to note is the A variants are not necessarily UTF-8 - they are whatever code page set on the system or manifested for your application. Converting UTF-8 to UTF-16 yourself and then calling the W variants is more reliable if you are not aware of the settings.