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

💡 Failed to parse Unicode of emoticons 💡 #4048

Closed
AbhijithGanesh opened this issue Jun 22, 2024 · 2 comments
Closed

💡 Failed to parse Unicode of emoticons 💡 #4048

AbhijithGanesh opened this issue Jun 22, 2024 · 2 comments

Comments

@AbhijithGanesh
Copy link

AbhijithGanesh commented Jun 22, 2024

Exception report

PS fails to parse emoticons

Heyy devs, I was using PS and I tried to add "💡" as a part of my git commits and I thought git broke but I realized PS broke and asked me to create an issue. I'd like to fix this if it is not very hard.

Screenshot

image

Environment data

### Environment
PSReadLine: 2.0.0
PowerShell: 5.1.22621.3672
OS: Microsoft Windows 10.0.22631
Last 200 Keys

Steps to reproduce

mkdir sample
cd sample
touch input.txt
git add input.txt
git commit -m "Initial commit💡"

Expected behavior

Should allow me to commit/should understand that I am trying to input unicode emoticons

Actual behavior

Breaks due to this exception:

System.Text.EncoderFallbackException: Unable to translate Unicode character \uD83D at index 1 to specified code page.
   at System.Text.EncoderExceptionFallbackBuffer.Fallback(Char charUnknown, Int32 index)
   at System.Text.EncoderFallbackBuffer.InternalFallback(Char ch, Char*& chars)
   at System.Text.UTF8Encoding.GetBytes(Char* chars, Int32 charCount, Byte* bytes, Int32 byteCount, EncoderNLS baseEncoder)
   at System.Text.EncoderNLS.GetBytes(Char[] chars, Int32 charIndex, Int32 charCount, Byte[] bytes, Int32 byteIndex, Boolean flush)
   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__DisplayClass83_0.<WriteHistoryRange>b__0()
   at Microsoft.PowerShell.PSConsoleReadLine.WithHistoryFileMutexDo(Int32 timeout, Action action)
   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)
@microsoft-github-policy-service microsoft-github-policy-service bot added the Needs-Triage 🔍 It's a new issue that core contributor team needs to triage. label Jun 22, 2024
@AbhijithGanesh
Copy link
Author

I'd like to work on this issue and fix it myself, I am already a party to the Microsoft CLA and I am a previous contributor to Data API Builder

@daxian-dbw
Copy link
Member

This is an issue with the VSCode terminal -- only the high surrogate of the surrogate pair representing that emoji gets pasted into the read-line buffer of PSReadLine. This could be because you are on an old version of Windows. See the following 2 comments for more information

Will close as a duplicate of #3832

@daxian-dbw daxian-dbw removed the Needs-Triage 🔍 It's a new issue that core contributor team needs to triage. label Jun 24, 2024
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

No branches or pull requests

2 participants