EncoderFallbackException: Unable to translate Unicode character
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 45/100
Hướng nghiên cứu
Start with the PSConsoleReadLine.WriteHistoryRange and IncrementalHistoryWrite paths shown in the exception stack trace, then reproduce the paste, cursor movement, deletion, and Enter sequence on Windows. Done means the Unicode input is handled without EncoderFallbackException and the terminal shows the expected text after deletion.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Prerequisites
- Write a descriptive title.
- Make sure you are able to repro it on the latest released version
- Search the existing issues, especially the pinned issues.
Exception report
PS C:\Users\x> ✓ ✔ �
Oops, something went wrong.
Please report this bug with ALL the details below, including both the 'Environment' and 'Exception' sections.
Please report on GitHub: https://github.com/PowerShell/PSReadLine/issues/new?template=Bug_Report.yaml
Thank you!
### Environment
PSReadLine: 2.3.6+d2e770f93b7a53d8660a6402eb29d1ae1c35e767
PowerShell: 7.5.4
OS: Microsoft Windows 10.0.26200
BufferWidth: 378
BufferHeight: 70
Last 37 Keys:
✓ Spacebar ✔ Spacebar � � LeftArrow End Delete RightArrow LeftArrow Delete Enter
Ctrl+Backspace Backspace Backspace Backspace Ctrl+Backspace Ctrl+Backspace Ctrl+Backspace Ctrl+Backspace RightArrow RightArrow Backspace c l s Enter
✓ Spacebar ✔ Spacebar � � LeftArrow Delete Enter
### Exception
System.Text.EncoderFallbackException: Unable to translate Unicode character \\uD83D at index 4 to specified code page.
at System.Text.EncoderExceptionFallbackBuffer.Fallback(Char charUnknown, Int32 index)
at System.Text.Encoding.GetBytesWithFallback(ReadOnlySpan`1 chars, Int32 originalCharsLength, Span`1 bytes, Int32 originalBytesLength, EncoderNLS encoder, Boolean throwForDestinationOverflow)
at System.Text.Encoding.GetBytesWithFallback(Char* pOriginalChars, Int32 originalCharCount, Byte* pOriginalBytes, Int32 originalByteCount, Int32 charsConsumedSoFar, Int32 bytesWrittenSoFar, EncoderNLS encoder)
at System.IO.StreamWriter.Flush(Boolean flushStream, Boolean flushEncoder)
at System.IO.StreamWriter.Dispose(Boolean disposing)
at System.IO.TextWriter.Dispose()
at Microsoft.PowerShell.PSConsoleReadLine.<>c__DisplayClass103_0.<WriteHistoryRange>b__0()
at Microsoft.PowerShell.PSConsoleReadLine.<>c__DisplayClass103_0.<WriteHistoryRange>b__0()
at Microsoft.PowerShell.PSConsoleReadLine.WithHistoryFileMutexDo(Int32 timeout, Action action)
at Microsoft.PowerShell.PSConsoleReadLine.WriteHistoryRange(Int32 start, Int32 end, Boolean overwritten)
at Microsoft.PowerShell.PSConsoleReadLine.IncrementalHistoryWrite()
at Microsoft.PowerShell.PSConsoleReadLine.MaybeAddToHistory(String result, List`1 edits, Int32 undoEditIndex, Boolean fromDifferentSession, Boolean fromInitialRead)
at Microsoft.PowerShell.PSConsoleReadLine.InputLoop()
at Microsoft.PowerShell.PSConsoleReadLine.ReadLine(Runspace runspace, EngineIntrinsics engineIntrinsics, CancellationToken cancellationToken, Nullable`1 lastRunStatus)
PS C:\Users\x> ✓ ✔ �
Screenshot
Pasting:
PS C:\Users\x> ✓ ✔ 🗸
Actually pastes:
PS C:\Users\x> ✓ ✔ 🗸�
So performing the above mentioned steps will result in the given error.
Visual Example of input:
PS C:\Users\x> ✓ ✔ 🗸|�
Environment data
PS Version: 7.5.4
PS HostName: ConsoleHost (Windows Terminal)
PSReadLine Version: 2.3.6
PSReadLine EditMode: Windows
OS: 10.0.26100.1 (WinBuild.160101.0800)
BufferWidth: 340
BufferHeight: 67
Steps to reproduce
Pasting:
PS C:\Users\x> ✓ ✔ 🗸
Actually pastes:
PS C:\Users\x> ✓ ✔ 🗸�
So performing the above mentioned steps will result in the given error.
Visual Example of input:
Paste:
Press [Left arrow key]:
Press [delete]:
Press [enter]:
Expected behavior
Terminal should show:
PS C:\Users\x> ✓ ✔ 🗸
PS C:\Users\x> ✓ ✔ -> Where the last chracter is deleted
Actual behavior
Terminal shows:
PS C:\Users\x> ✓ ✔ 🗸\
PS C:\Users\x> ✓ ✔ �� -> Where the last chracter is deleted
- Ngôn ngữ chính
- C#
- Star
- 4.4k
- Fork
- 341
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của PowerShell/PSReadLine
-
Needs-Triage :mag:
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
PowerShell/PSReadLine#5205 ·
-
Needs-Triage :mag:
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
PowerShell/PSReadLine#5195 ·
-
Needs-Triage :mag:
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
PowerShell/PSReadLine#5121 ·
-
Needs-Triage :mag:
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 64/100
PowerShell/PSReadLine#5045 ·
-
Area-CommandHelp Issue-Enhancement
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 68/100
PowerShell/PSReadLine#3470 · 3 reaction ·
Tất cả issue của PowerShell/PSReadLine
Issue tương tự
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
nightscout/nocturne#1425 ·
-
【Bug】dotnet版本多行输出解析不兼容(含AI解决办法) Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
RayWangQvQ/BiliBiliToolPro#1137 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100