Skip to content
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

Add information about console output encoding #9753

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 50 additions & 7 deletions xml/System/Console.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4413,7 +4413,7 @@ This method can be used to reacquire the standard output stream after it has bee
## Remarks
The text representation of `value` is produced by calling <xref:System.Boolean.ToString%2A?displayProperty=nameWithType>, which outputs either <xref:System.Boolean.TrueString?displayProperty=nameWithType> or <xref:System.Boolean.FalseString?displayProperty=nameWithType>.


The output is encoded according to <xref:System.Console.OutputEncoding%2A>.

## Examples
The following example illustrates the use of the `Write` method.
Expand Down Expand Up @@ -4475,6 +4475,8 @@ This method can be used to reacquire the standard output stream after it has bee
<remarks>
<format type="text/markdown"><![CDATA[

The output is encoded according to <xref:System.Console.OutputEncoding%2A>.

## Examples
The following example illustrates the use of the `Write` method.

Expand Down Expand Up @@ -4593,7 +4595,9 @@ This method can be used to reacquire the standard output stream after it has bee
## Remarks
The text representation of `value` is produced by calling <xref:System.Decimal.ToString%2A?displayProperty=nameWithType>.

The output is encoded according to <xref:System.Console.OutputEncoding%2A>.

This method is intended for writing text, so be sure that the input array is well-formed. For example, surrogate pairs in the input may be interpreted as runes and re-encoded before output, and a terminating unpaired surrogate may be truncated.

## Examples
The following example illustrates the use of the `Write` method.
Expand Down Expand Up @@ -4658,7 +4662,7 @@ This method can be used to reacquire the standard output stream after it has bee
## Remarks
The text representation of `value` is produced by calling the <xref:System.Double.ToString%2A?displayProperty=nameWithType> method.


The output is encoded according to <xref:System.Console.OutputEncoding%2A>.

## Examples
The following example illustrates the use of the `Write` method.
Expand Down Expand Up @@ -4723,6 +4727,7 @@ This method can be used to reacquire the standard output stream after it has bee
## Remarks
The text representation of `value` is produced by calling the <xref:System.Int32.ToString%2A?displayProperty=nameWithType> method.

The output is encoded according to <xref:System.Console.OutputEncoding%2A>.


## Examples
Expand Down Expand Up @@ -4788,6 +4793,7 @@ This method can be used to reacquire the standard output stream after it has bee
## Remarks
The text representation of `value` is produced by calling the <xref:System.Int64.ToString%2A?displayProperty=nameWithType> method.

The output is encoded according to <xref:System.Console.OutputEncoding%2A>.


## Examples
Expand Down Expand Up @@ -4860,6 +4866,7 @@ This method can be used to reacquire the standard output stream after it has bee
## Remarks
If `value` is `null`, nothing is written and no exception is thrown. Otherwise, the `ToString` method of `value` is called to produce its string representation, and the resulting string is written to the standard output stream.

The output is encoded according to <xref:System.Console.OutputEncoding%2A>.


## Examples
Expand Down Expand Up @@ -4925,6 +4932,7 @@ This method can be used to reacquire the standard output stream after it has bee
## Remarks
The text representation of `value` is produced by calling the <xref:System.Single.ToString%2A?displayProperty=nameWithType> method.

The output is encoded according to <xref:System.Console.OutputEncoding%2A>.


## Examples
Expand Down Expand Up @@ -4995,8 +5003,9 @@ This method can be used to reacquire the standard output stream after it has bee
<format type="text/markdown"><![CDATA[

## Remarks
If value is `null`, nothing is written to the standard output stream.
The output is encoded according to <xref:System.Console.OutputEncoding%2A>.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(I reordered this to put my comment first, because otherwise there's a syntactic ambiguity about whether my comment is conditioned on the "value is null" from the other comment.)


If value is `null`, nothing is written to the standard output stream.


## Examples
Expand Down Expand Up @@ -5068,6 +5077,7 @@ This method can be used to reacquire the standard output stream after it has bee
## Remarks
The text representation of `value` is produced by calling the <xref:System.UInt32.ToString%2A?displayProperty=nameWithType> method.

The output is encoded according to <xref:System.Console.OutputEncoding%2A>.


## Examples
Expand Down Expand Up @@ -5139,6 +5149,7 @@ This method can be used to reacquire the standard output stream after it has bee
## Remarks
The text representation of `value` is produced by calling the <xref:System.UInt64.ToString%2A?displayProperty=nameWithType> method.

The output is encoded according to <xref:System.Console.OutputEncoding%2A>.


## Examples
Expand Down Expand Up @@ -5237,6 +5248,7 @@ This method can be used to reacquire the standard output stream after it has bee

- For more information about formatting, see [Formatting Types](/dotnet/standard/base-types/formatting-types).

The output is encoded according to <xref:System.Console.OutputEncoding%2A>.


## Examples
Expand Down Expand Up @@ -5351,8 +5363,9 @@ This method can be used to reacquire the standard output stream after it has bee

- For more information about formatting, see [Formatting Types](/dotnet/standard/base-types/formatting-types).

The `arg` parameter is a parameter array. Arguments can be passed to the method either as an array or as list of five or more items. The examples illustrate both forms of method call.
The `arg` parameter is a parameter array. Arguments can be passed to the method either as an array or as list of five or more items. The examples illustrate both forms of method call.

The output is encoded according to <xref:System.Console.OutputEncoding%2A>.


## Examples
Expand Down Expand Up @@ -5437,6 +5450,10 @@ This method can be used to reacquire the standard output stream after it has bee
## Remarks
This method writes `count` characters starting at position `index` of `buffer` to the standard output stream.

The output is encoded according to <xref:System.Console.OutputEncoding%2A>.

This method is intended for writing text, so be sure that the input array is well-formed. For example, surrogate pairs in the input may be interpreted as runes and re-encoded before output, and a terminating unpaired surrogate may be truncated.

]]></format>
</remarks>
<exception cref="T:System.ArgumentNullException">
Expand Down Expand Up @@ -5536,7 +5553,7 @@ This method can be used to reacquire the standard output stream after it has bee

- For more information about formatting, see [Formatting Types](/dotnet/standard/base-types/formatting-types).


The output is encoded according to <xref:System.Console.OutputEncoding%2A>.

## Examples
The following example uses the `WriteLine` method to demonstrate the standard formatting specifiers for numbers, dates, and enumerations.
Expand Down Expand Up @@ -5653,7 +5670,7 @@ This method can be used to reacquire the standard output stream after it has bee

- For more information about formatting, see [Formatting Types](/dotnet/standard/base-types/formatting-types).


The output is encoded according to <xref:System.Console.OutputEncoding%2A>.

## Examples
The following example uses the `WriteLine` method to demonstrate the standard formatting specifiers for numbers, dates, and enumerations.
Expand Down Expand Up @@ -5757,6 +5774,7 @@ This method can be used to reacquire the standard output stream after it has bee

- For more information about formatting, see [Formatting Types](/dotnet/standard/base-types/formatting-types).

The output is encoded according to <xref:System.Console.OutputEncoding%2A>.


## Examples
Expand Down Expand Up @@ -5793,6 +5811,8 @@ This method can be used to reacquire the standard output stream after it has bee
## Remarks
The default line terminator is a string whose value is a carriage return followed by a line feed ("\r\n" in C#, or `vbCrLf` in Visual Basic). You can change the line terminator by setting the <xref:System.IO.TextWriter.NewLine%2A?displayProperty=nameWithType> property of the <xref:System.Console.Out%2A> property to another string.

Strings are encoded according to <xref:System.Console.OutputEncoding%2A>.

]]></format>
</remarks>
</Docs>
Expand Down Expand Up @@ -5910,7 +5930,7 @@ This method can be used to reacquire the standard output stream after it has bee

For more information about the line terminator, see the Remarks section of the <xref:System.Console.WriteLine%2A> method that takes no parameters.


The output is encoded according to <xref:System.Console.OutputEncoding%2A>.

## Examples
The following example generates ten random integers and uses the <xref:System.Console.WriteLine%28System.Boolean%29?displayProperty=nameWithType> method to indicate whether they are even.
Expand Down Expand Up @@ -5975,6 +5995,7 @@ This method can be used to reacquire the standard output stream after it has bee
## Remarks
For more information about the line terminator, see the Remarks section of the <xref:System.Console.WriteLine%2A> method that takes no parameters.

The output is encoded according to <xref:System.Console.OutputEncoding%2A>.


## Examples
Expand Down Expand Up @@ -6046,6 +6067,10 @@ This method can be used to reacquire the standard output stream after it has bee
## Remarks
For more information about the line terminator, see the Remarks section of the <xref:System.Console.WriteLine%2A> method that takes no parameters.

The output is encoded according to <xref:System.Console.OutputEncoding%2A>.

This method is intended for writing text, so be sure that the input array is well-formed. For example, surrogate pairs in the input may be interpreted as runes and re-encoded before output, and a terminating unpaired surrogate may be truncated.

]]></format>
</remarks>
<exception cref="T:System.IO.IOException">An I/O error occurred.</exception>
Expand Down Expand Up @@ -6103,6 +6128,7 @@ This method can be used to reacquire the standard output stream after it has bee

For more information about the line terminator, see the Remarks section of the <xref:System.Console.WriteLine%2A> method that takes no parameters.

The output is encoded according to <xref:System.Console.OutputEncoding%2A>.


## Examples
Expand Down Expand Up @@ -6169,6 +6195,7 @@ This method can be used to reacquire the standard output stream after it has bee

For more information about the line terminator, see the Remarks section of the <xref:System.Console.WriteLine%2A> method that takes no parameters.

The output is encoded according to <xref:System.Console.OutputEncoding%2A>.


## Examples
Expand Down Expand Up @@ -6235,6 +6262,7 @@ This method can be used to reacquire the standard output stream after it has bee

For more information about the line terminator, see the Remarks section of the <xref:System.Console.WriteLine%2A> method that takes no parameters.

The output is encoded according to <xref:System.Console.OutputEncoding%2A>.


## Examples
Expand Down Expand Up @@ -6301,6 +6329,7 @@ This method can be used to reacquire the standard output stream after it has bee

For more information about the line terminator, see the Remarks section of the <xref:System.Console.WriteLine%2A> method that takes no parameters.

The output is encoded according to <xref:System.Console.OutputEncoding%2A>.


## Examples
Expand Down Expand Up @@ -6374,6 +6403,7 @@ This method can be used to reacquire the standard output stream after it has bee

For more information about the line terminator, see the Remarks section of the <xref:System.Console.WriteLine%2A> method that takes no parameters.

The output is encoded according to <xref:System.Console.OutputEncoding%2A>.


## Examples
Expand Down Expand Up @@ -6441,6 +6471,7 @@ This method can be used to reacquire the standard output stream after it has bee

For more information about the line terminator, see the Remarks section of the <xref:System.Console.WriteLine%2A> method that takes no parameters.

The output is encoded according to <xref:System.Console.OutputEncoding%2A>.


## Examples
Expand Down Expand Up @@ -6514,6 +6545,7 @@ This method can be used to reacquire the standard output stream after it has bee

For more information about the line terminator, see the Remarks section of the <xref:System.Console.WriteLine> method.

The output is encoded according to <xref:System.Console.OutputEncoding%2A>.


## Examples
Expand Down Expand Up @@ -6587,6 +6619,7 @@ This method can be used to reacquire the standard output stream after it has bee

For more information about the line terminator, see the Remarks section of the <xref:System.Console.WriteLine%2A> method that takes no parameters.

The output is encoded according to <xref:System.Console.OutputEncoding%2A>.


## Examples
Expand Down Expand Up @@ -6659,6 +6692,7 @@ This method can be used to reacquire the standard output stream after it has bee

For more information about the line terminator, see the Remarks section of the <xref:System.Console.WriteLine%2A> method that takes no parameters.

The output is encoded according to <xref:System.Console.OutputEncoding%2A>.


## Examples
Expand Down Expand Up @@ -6758,6 +6792,7 @@ This method can be used to reacquire the standard output stream after it has bee

For more information about the line terminator, see the Remarks section of the <xref:System.Console.WriteLine%2A> method that takes no parameters.

The output is encoded according to <xref:System.Console.OutputEncoding%2A>.


## Examples
Expand Down Expand Up @@ -6872,6 +6907,7 @@ This method can be used to reacquire the standard output stream after it has bee

For more information about the line terminator, see the Remarks section of the <xref:System.Console.WriteLine%2A> method that takes no parameters.

The output is encoded according to <xref:System.Console.OutputEncoding%2A>.


## Examples
Expand Down Expand Up @@ -6957,6 +6993,10 @@ This method can be used to reacquire the standard output stream after it has bee

For more information about the line terminator, see the Remarks section of the <xref:System.Console.WriteLine%2A> method that takes no parameters.

The output is encoded according to <xref:System.Console.OutputEncoding%2A>.

This method is intended for writing text, so be sure that the input array is well-formed. For example, surrogate pairs in the input may be interpreted as runes and re-encoded before output, and a terminating unpaired surrogate may be truncated.

]]></format>
</remarks>
<exception cref="T:System.ArgumentNullException">
Expand Down Expand Up @@ -7058,6 +7098,7 @@ This method can be used to reacquire the standard output stream after it has bee

For more information about the line terminator, see the Remarks section of the <xref:System.Console.WriteLine%2A> method that takes no parameters.

The output is encoded according to <xref:System.Console.OutputEncoding%2A>.


## Examples
Expand Down Expand Up @@ -7176,6 +7217,7 @@ This method can be used to reacquire the standard output stream after it has bee

For more information about the line terminator, see the Remarks section of the <xref:System.Console.WriteLine%2A> method that takes no parameters.

The output is encoded according to <xref:System.Console.OutputEncoding%2A>.


## Examples
Expand Down Expand Up @@ -7281,6 +7323,7 @@ This method can be used to reacquire the standard output stream after it has bee

For more information about the line terminator, see the Remarks section of the <xref:System.Console.WriteLine%2A> method that takes no parameters.

The output is encoded according to <xref:System.Console.OutputEncoding%2A>.


## Examples
Expand Down
Loading