Skip to content

Commit

Permalink
UTFn->UTF-n (#88913)
Browse files Browse the repository at this point in the history
* resx

* cs comments

* oops
  • Loading branch information
danmoseley committed Jul 14, 2023
1 parent acedeb2 commit 30e19b9
Show file tree
Hide file tree
Showing 37 changed files with 119 additions and 119 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -194,10 +194,10 @@ public static byte[] DeriveBytes(byte[] key, HashAlgorithmName hashAlgorithm, by
/// <paramref name="hashAlgorithm"/> is not a known or supported hash algorithm.
/// </exception>
/// <exception cref="EncoderFallbackException">
/// <paramref name="label" /> or <paramref name="context" /> contains text that cannot be converted to UTF8.
/// <paramref name="label" /> or <paramref name="context" /> contains text that cannot be converted to UTF-8.
/// </exception>
/// <remarks>
/// <paramref name="label" /> and <paramref name="context" /> will be converted to bytes using the UTF8 encoding.
/// <paramref name="label" /> and <paramref name="context" /> will be converted to bytes using the UTF-8 encoding.
/// for other encodings, perform the conversion using the desired encoding and use an overload which accepts the
/// label and context as a sequence of bytes.
/// </remarks>
Expand Down Expand Up @@ -310,13 +310,13 @@ public static void DeriveBytes(ReadOnlySpan<byte> key, HashAlgorithmName hashAlg
/// <paramref name="hashAlgorithm"/> is not a known or supported hash algorithm.
/// </exception>
/// <exception cref="EncoderFallbackException">
/// <paramref name="label" /> or <paramref name="context" /> contains text that cannot be converted to UTF8.
/// <paramref name="label" /> or <paramref name="context" /> contains text that cannot be converted to UTF-8.
/// </exception>
/// <exception cref="PlatformNotSupportedException">
/// The current platform does not have a supported implementation of HMAC.
/// </exception>
/// <remarks>
/// <paramref name="label" /> and <paramref name="context" /> will be converted to bytes using the UTF8 encoding.
/// <paramref name="label" /> and <paramref name="context" /> will be converted to bytes using the UTF-8 encoding.
/// for other encodings, perform the conversion using the desired encoding and use an overload which accepts the
/// label and context as a sequence of bytes.
/// </remarks>
Expand Down Expand Up @@ -350,13 +350,13 @@ public static byte[] DeriveBytes(ReadOnlySpan<byte> key, HashAlgorithmName hashA
/// <paramref name="hashAlgorithm"/> is not a known or supported hash algorithm.
/// </exception>
/// <exception cref="EncoderFallbackException">
/// <paramref name="label" /> or <paramref name="context" /> contains text that cannot be converted to UTF8.
/// <paramref name="label" /> or <paramref name="context" /> contains text that cannot be converted to UTF-8.
/// </exception>
/// <exception cref="PlatformNotSupportedException">
/// The current platform does not have a supported implementation of HMAC.
/// </exception>
/// <remarks>
/// <paramref name="label" /> and <paramref name="context" /> will be converted to bytes using the UTF8 encoding.
/// <paramref name="label" /> and <paramref name="context" /> will be converted to bytes using the UTF-8 encoding.
/// for other encodings, perform the conversion using the desired encoding and use an overload which accepts the
/// label and context as a sequence of bytes.
/// </remarks>
Expand Down Expand Up @@ -458,10 +458,10 @@ public void DeriveKey(ReadOnlySpan<byte> label, ReadOnlySpan<byte> context, Span
/// that can be derived.
/// </exception>
/// <exception cref="EncoderFallbackException">
/// <paramref name="label" /> or <paramref name="context" /> contains text that cannot be converted to UTF8.
/// <paramref name="label" /> or <paramref name="context" /> contains text that cannot be converted to UTF-8.
/// </exception>
/// <remarks>
/// <paramref name="label" /> and <paramref name="context" /> will be converted to bytes using the UTF8 encoding.
/// <paramref name="label" /> and <paramref name="context" /> will be converted to bytes using the UTF-8 encoding.
/// for other encodings, perform the conversion using the desired encoding and use an overload which accepts the
/// label and context as a sequence of bytes.
/// </remarks>
Expand All @@ -484,10 +484,10 @@ public byte[] DeriveKey(ReadOnlySpan<char> label, ReadOnlySpan<char> context, in
/// <paramref name="destination" /> is larger than the maximum number of bytes that can be derived.
/// </exception>
/// <exception cref="EncoderFallbackException">
/// <paramref name="label" /> or <paramref name="context" /> contains text that cannot be converted to UTF8.
/// <paramref name="label" /> or <paramref name="context" /> contains text that cannot be converted to UTF-8.
/// </exception>
/// <remarks>
/// <paramref name="label" /> and <paramref name="context" /> will be converted to bytes using the UTF8 encoding.
/// <paramref name="label" /> and <paramref name="context" /> will be converted to bytes using the UTF-8 encoding.
/// for other encodings, perform the conversion using the desired encoding and use an overload which accepts the
/// label and context as a sequence of bytes.
/// </remarks>
Expand Down Expand Up @@ -518,10 +518,10 @@ public void DeriveKey(ReadOnlySpan<char> label, ReadOnlySpan<char> context, Span
/// that can be derived.
/// </exception>
/// <exception cref="EncoderFallbackException">
/// <paramref name="label" /> or <paramref name="context" /> contains text that cannot be converted to UTF8.
/// <paramref name="label" /> or <paramref name="context" /> contains text that cannot be converted to UTF-8.
/// </exception>
/// <remarks>
/// <paramref name="label" /> and <paramref name="context" /> will be converted to bytes using the UTF8 encoding.
/// <paramref name="label" /> and <paramref name="context" /> will be converted to bytes using the UTF-8 encoding.
/// for other encodings, perform the conversion using the desired encoding and use an overload which accepts the
/// label and context as a sequence of bytes.
/// </remarks>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -829,7 +829,7 @@ private bool TryReadEvent(out NotifyEvent notifyEvent)
}

/// <summary>
/// Reads a UTF8 string from _buffer starting at the specified position and up to
/// Reads a UTF-8 string from _buffer starting at the specified position and up to
/// the specified length. Null termination is trimmed off (the length may include
/// many null bytes, not just one, or it may include none).
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@
<value>The close status code '{0}' is reserved for system use only and cannot be specified when calling this method.</value>
</data>
<data name="net_WebSockets_InvalidCloseStatusDescription" xml:space="preserve">
<value>The close status description '{0}' is too long. The UTF8-representation of the status description must not be longer than {1} bytes.</value>
<value>The close status description '{0}' is too long. The UTF-8 representation of the status description must not be longer than {1} bytes.</value>
</data>
<data name="net_WebSockets_UnsupportedPlatform" xml:space="preserve">
<value>The WebSocket protocol is not supported on this platform.</value>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ public bool TryFormat(Span<char> destination, out int charsWritten) =>
TryFormatCore(destination, out charsWritten);

/// <summary>Tries to format the current IP address into the provided span.</summary>
/// <param name="utf8Destination">When this method returns, the IP address as a span of UTF8 bytes.</param>
/// <param name="utf8Destination">When this method returns, the IP address as a span of UTF-8 bytes.</param>
/// <param name="bytesWritten">When this method returns, the number of bytes written into the <paramref name="utf8Destination"/>.</param>
/// <returns><see langword="true" /> if the formatting was successful; otherwise, <see langword="false" />.</returns>
public bool TryFormat(Span<byte> utf8Destination, out int bytesWritten) =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -252,9 +252,9 @@ public bool TryFormat(Span<char> destination, out int charsWritten) =>
destination.TryWrite(CultureInfo.InvariantCulture, $"{BaseAddress}/{(uint)PrefixLength}", out charsWritten);

/// <summary>
/// Attempts to write the <see cref="IPNetwork"/>'s CIDR notation to the given <paramref name="utf8Destination"/> UTF8 span and returns a value indicating whether the operation succeeded.
/// Attempts to write the <see cref="IPNetwork"/>'s CIDR notation to the given <paramref name="utf8Destination"/> UTF-8 span and returns a value indicating whether the operation succeeded.
/// </summary>
/// <param name="utf8Destination">The destination span of UTF8 bytes.</param>
/// <param name="utf8Destination">The destination span of UTF-8 bytes.</param>
/// <param name="bytesWritten">When this method returns, contains the number of bytes that were written to <paramref name="utf8Destination"/>.</param>
/// <returns><see langword="true"/> if the formatting was succesful; otherwise <see langword="false"/>.</returns>
public bool TryFormat(Span<byte> utf8Destination, out int bytesWritten) =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@
<value>The close status code '{0}' is reserved for system use only and cannot be specified when calling this method.</value>
</data>
<data name="net_WebSockets_InvalidCloseStatusDescription" xml:space="preserve">
<value>The close status description '{0}' is too long. The UTF8-representation of the status description must not be longer than {1} bytes.</value>
<value>The close status description '{0}' is too long. The UTF-8 representation of the status description must not be longer than {1} bytes.</value>
</data>
<data name="net_WebSockets_Scheme" xml:space="preserve">
<value>Only Uris starting with 'ws://' or 'wss://' are supported.</value>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@
<value>The close status code '{0}' is reserved for system use only and cannot be specified when calling this method.</value>
</data>
<data name="net_WebSockets_InvalidCloseStatusDescription" xml:space="preserve">
<value>The close status description '{0}' is too long. The UTF8-representation of the status description must not be longer than {1} bytes.</value>
<value>The close status description '{0}' is too long. The UTF-8 representation of the status description must not be longer than {1} bytes.</value>
</data>
<data name="net_WebSockets_UnsupportedPlatform" xml:space="preserve">
<value>The WebSocket protocol is not supported on this platform.</value>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ namespace System.Net.WebSockets
/// </remarks>
internal sealed partial class ManagedWebSocket : WebSocket
{
/// <summary>Encoding for the payload of text messages: UTF8 encoding that throws if invalid bytes are discovered, per the RFC.</summary>
/// <summary>Encoding for the payload of text messages: UTF-8 encoding that throws if invalid bytes are discovered, per the RFC.</summary>
private static readonly UTF8Encoding s_textEncoding = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: true);

/// <summary>Valid states to be in when calling SendAsync.</summary>
Expand Down Expand Up @@ -61,7 +61,7 @@ internal sealed partial class ManagedWebSocket : WebSocket
/// <summary>Buffer used for reading data from the network.</summary>
private readonly Memory<byte> _receiveBuffer;
/// <summary>
/// Tracks the state of the validity of the UTF8 encoding of text payloads. Text may be split across fragments.
/// Tracks the state of the validity of the UTF-8 encoding of text payloads. Text may be split across fragments.
/// </summary>
private readonly Utf8MessageState _utf8TextState = new Utf8MessageState();
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,7 @@
<value>The signature Type array contains some invalid type (i.e. null, void)</value>
</data>
<data name="Arg_InvalidUTF8String" xml:space="preserve">
<value>The UTF8 string passed in could not be converted to Unicode.</value>
<value>The UTF-8 string passed in could not be converted to Unicode.</value>
</data>
<data name="Arg_IOException" xml:space="preserve">
<value>I/O error occurred.</value>
Expand Down Expand Up @@ -1292,7 +1292,7 @@
<value>The NativeDigits array must contain exactly ten members.</value>
</data>
<data name="Argument_InvalidNativeDigitValue" xml:space="preserve">
<value>Each member of the NativeDigits array must be a single text element (one or more UTF16 code points) with a Unicode Nd (Number, Decimal Digit) property indicating it is a digit.</value>
<value>Each member of the NativeDigits array must be a single text element (one or more UTF-16 code points) with a Unicode Nd (Number, Decimal Digit) property indicating it is a digit.</value>
</data>
<data name="Argument_InvalidNeutralRegionName" xml:space="preserve">
<value>The region name {0} should not correspond to neutral culture; a specific culture name is required.</value>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ public static bool IsValid(ReadOnlySpan<char> base64Text) =>
public static bool IsValid(ReadOnlySpan<char> base64Text, out int decodedLength) =>
IsValid<char, Base64CharValidatable>(base64Text, out decodedLength);

/// <summary>Validates that the specified span of UTF8 text is comprised of valid base-64 encoded data.</summary>
/// <param name="base64TextUtf8">A span of UTF8 text to validate.</param>
/// <summary>Validates that the specified span of UTF-8 text is comprised of valid base-64 encoded data.</summary>
/// <param name="base64TextUtf8">A span of UTF-8 text to validate.</param>
/// <returns><see langword="true"/> if <paramref name="base64TextUtf8"/> contains a valid, decodable sequence of base-64 encoded data; otherwise, <see langword="false"/>.</returns>
/// <remarks>
/// If the method returns <see langword="true"/>, the same text passed to <see cref="DecodeFromUtf8"/> and
Expand All @@ -41,9 +41,9 @@ public static bool IsValid(ReadOnlySpan<char> base64Text, out int decodedLength)
public static bool IsValid(ReadOnlySpan<byte> base64TextUtf8) =>
IsValid<byte, Base64ByteValidatable>(base64TextUtf8, out _);

/// <summary>Validates that the specified span of UTF8 text is comprised of valid base-64 encoded data.</summary>
/// <param name="base64TextUtf8">A span of UTF8 text to validate.</param>
/// <param name="decodedLength">If the method returns true, the number of decoded bytes that will result from decoding the input UTF8 text.</param>
/// <summary>Validates that the specified span of UTF-8 text is comprised of valid base-64 encoded data.</summary>
/// <param name="base64TextUtf8">A span of UTF-8 text to validate.</param>
/// <param name="decodedLength">If the method returns true, the number of decoded bytes that will result from decoding the input UTF-8 text.</param>
/// <returns><see langword="true"/> if <paramref name="base64TextUtf8"/> contains a valid, decodable sequence of base-64 encoded data; otherwise, <see langword="false"/>.</returns>
/// <remarks>
/// If the method returns <see langword="true"/>, the same text passed to <see cref="DecodeFromUtf8"/> and
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ namespace System.Buffers.Text
public static partial class Utf8Formatter
{
/// <summary>
/// Formats a Boolean as a UTF8 string.
/// Formats a Boolean as a UTF-8 string.
/// </summary>
/// <param name="value">Value to format</param>
/// <param name="destination">Buffer to write the UTF8-formatted value to</param>
/// <param name="destination">Buffer to write the UTF-8 formatted value to</param>
/// <param name="bytesWritten">Receives the length of the formatted text in bytes</param>
/// <param name="format">The standard format to use</param>
/// <returns>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ namespace System.Buffers.Text
public static partial class Utf8Formatter
{
/// <summary>
/// Formats a DateTimeOffset as a UTF8 string.
/// Formats a DateTimeOffset as a UTF-8 string.
/// </summary>
/// <param name="value">Value to format</param>
/// <param name="destination">Buffer to write the UTF8-formatted value to</param>
/// <param name="destination">Buffer to write the UTF-8 formatted value to</param>
/// <param name="bytesWritten">Receives the length of the formatted text in bytes</param>
/// <param name="format">The standard format to use</param>
/// <returns>
Expand Down Expand Up @@ -58,10 +58,10 @@ public static bool TryFormat(DateTimeOffset value, Span<byte> destination, out i
}

/// <summary>
/// Formats a DateTime as a UTF8 string.
/// Formats a DateTime as a UTF-8 string.
/// </summary>
/// <param name="value">Value to format</param>
/// <param name="destination">Buffer to write the UTF8-formatted value to</param>
/// <param name="destination">Buffer to write the UTF-8 formatted value to</param>
/// <param name="bytesWritten">Receives the length of the formatted text in bytes</param>
/// <param name="format">The standard format to use</param>
/// <returns>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ namespace System.Buffers.Text
public static partial class Utf8Formatter
{
/// <summary>
/// Formats a Decimal as a UTF8 string.
/// Formats a Decimal as a UTF-8 string.
/// </summary>
/// <param name="value">Value to format</param>
/// <param name="destination">Buffer to write the UTF8-formatted value to</param>
/// <param name="destination">Buffer to write the UTF-8 formatted value to</param>
/// <param name="bytesWritten">Receives the length of the formatted text in bytes</param>
/// <param name="format">The standard format to use</param>
/// <returns>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ namespace System.Buffers.Text
public static partial class Utf8Formatter
{
/// <summary>
/// Formats a Double as a UTF8 string.
/// Formats a Double as a UTF-8 string.
/// </summary>
/// <param name="value">Value to format</param>
/// <param name="destination">Buffer to write the UTF8-formatted value to</param>
/// <param name="destination">Buffer to write the UTF-8 formatted value to</param>
/// <param name="bytesWritten">Receives the length of the formatted text in bytes</param>
/// <param name="format">The standard format to use</param>
/// <returns>
Expand All @@ -29,10 +29,10 @@ public static bool TryFormat(double value, Span<byte> destination, out int bytes
FormattingHelpers.TryFormat(value, destination, out bytesWritten, format);

/// <summary>
/// Formats a Single as a UTF8 string.
/// Formats a Single as a UTF-8 string.
/// </summary>
/// <param name="value">Value to format</param>
/// <param name="destination">Buffer to write the UTF8-formatted value to</param>
/// <param name="destination">Buffer to write the UTF-8 formatted value to</param>
/// <param name="bytesWritten">Receives the length of the formatted text in bytes</param>
/// <param name="format">The standard format to use</param>
/// <returns>
Expand Down
Loading

0 comments on commit 30e19b9

Please sign in to comment.