Skip to content

Document Base64Url character encoding details in API reference #11470

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 20, 2025

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Jun 19, 2025

This PR enhances the documentation for the System.Buffers.Text.Base64Url class to clearly specify which characters are used in Base64Url encoding, addressing a documentation gap identified by users.

Changes Made

Class-level documentation:

  • Updated the <remarks> section to explain that Base64Url uses the same alphabet as standard Base64 encoding, except that the characters + and / are replaced with - and _ respectively to make the output URL-safe.

Method-level documentation:

  • Enhanced the <remarks> section for all encoding methods (EncodeToString, EncodeToChars, EncodeToUtf8, and their overloads) to mention the specific character replacements.
  • Applied changes consistently across all 10 encoding method overloads to maintain API documentation consistency.

Before

The documentation only mentioned "URL-safe ASCII encoded text" and "Base64Url characters" without specifying what makes it URL-safe or what the actual character set differences are.

After

The documentation now clearly explains:

  • What characters replace the standard Base64 + and / characters (namely - and _)
  • Why these replacements make the encoding URL-safe
  • This information is consistently documented across all relevant methods

This change helps developers understand the practical differences between standard Base64 and Base64Url encoding without having to reference external specifications.

Fixes #11469.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

@Copilot Copilot AI changed the title [WIP] Mention the characters used in web-safe base64 encoding Document Base64Url character encoding details in API reference Jun 19, 2025
@Copilot Copilot AI requested a review from jeffhandley June 19, 2025 05:31
Copilot finished work on behalf of jeffhandley June 19, 2025 05:31
@jeffhandley jeffhandley marked this pull request as ready for review June 19, 2025 05:36
@jeffhandley jeffhandley requested a review from a team as a code owner June 19, 2025 05:36
@jeffhandley jeffhandley enabled auto-merge (squash) June 19, 2025 06:33
auto-merge was automatically disabled June 19, 2025 07:39

Head branch was pushed to by a user without write access

@Copilot Copilot AI requested a review from gewarren June 19, 2025 07:39
Copilot finished work on behalf of gewarren June 19, 2025 07:39
@jeffhandley jeffhandley merged commit 6a1b0a7 into main Jun 20, 2025
5 checks passed
@jeffhandley jeffhandley deleted the copilot/fix-11469 branch June 20, 2025 01:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Mention the characters used in web-safe base64 encoding
3 participants