-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Fix Console.Write on iOS #56713
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
Fix Console.Write on iOS #56713
Changes from 10 commits
71b3888
8f6f7bc
a97f0d5
90bf33c
e6806e4
2bdb6e7
612dc1c
6f8542b
47d8f01
4f0653a
14545a8
725e64c
5b8499c
61bb68b
68e10e7
ac45868
2e57d54
c8aa30f
b76ddfe
b999fff
49f5c41
aaa1f35
90da2a0
88685c7
976954b
245edb3
a234df5
34d215f
1eb7528
a2e118e
732a62f
9375848
7504d30
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||
|---|---|---|---|---|
| @@ -1,6 +1,7 @@ | ||||
| // Licensed to the .NET Foundation under one or more agreements. | ||||
| // The .NET Foundation licenses this file to you under the MIT license. | ||||
|
|
||||
| using System.Collections.Generic; | ||||
| using System.Diagnostics; | ||||
| using System.Diagnostics.CodeAnalysis; | ||||
| using System.Runtime.CompilerServices; | ||||
|
|
@@ -36,6 +37,8 @@ public class StreamWriter : TextWriter | |||
| private readonly char[] _charBuffer; | ||||
| private int _charPos; | ||||
| private int _charLen; | ||||
| private List<byte> _acc = new List<byte>(); | ||||
MaximLipnin marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||
| private int _lineStartPos; | ||||
| private bool _autoFlush; | ||||
| private bool _haveWrittenPreamble; | ||||
| private readonly bool _closable; | ||||
|
|
@@ -320,11 +323,55 @@ private void Flush(bool flushStream, bool flushEncoder) | |||
| (_byteBuffer = new byte[_encoding.GetMaxByteCount(_charBuffer.Length)]); | ||||
| } | ||||
|
|
||||
| int count = _encoder.GetBytes(new ReadOnlySpan<char>(_charBuffer, 0, _charPos), byteBuffer, flushEncoder); | ||||
| _charPos = 0; | ||||
| if (count > 0) | ||||
| if (OperatingSystem.IsIOS() || OperatingSystem.IsTvOS() || OperatingSystem.IsMacCatalyst()) | ||||
|
||||
| public override void Flush() |
Uh oh!
There was an error while loading. Please reload this page.