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

Powershell Bug $lists | ? { $_.DisplayName -eq '�Hábito' } #4261

Closed
3 tasks done
BraunerSabino opened this issue Nov 8, 2024 · 2 comments
Closed
3 tasks done

Powershell Bug $lists | ? { $_.DisplayName -eq '�Hábito' } #4261

BraunerSabino opened this issue Nov 8, 2024 · 2 comments
Labels
Resolution-Duplicate There's another issue on the tracker that's pretty much the same thing.

Comments

@BraunerSabino
Copy link

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

After:
$userid = '[email protected]'
$lists = Get-MgUserTodoList -UserId $userid
$lists | ? { $_.DisplayName -eq '�Hábito' }


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.4.0-beta0+923a890f2e7ea10465f3a80a2bc030121a1c2f68
PowerShell: 2024.4.0
OS: Microsoft Windows 10.0.22631
BufferWidth: 200
BufferHeight: 23

Last 200 Keys:

 Backspace Backspace Backspace Backspace Backspace t o Tab Tab Tab Tab Tab Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace $ l i s Tab Tab Backspace Enter
 UpArrow Spacebar 0 Backspace - u s Tab Spacebar $ u s e r Tab Enter
 $ l i s t Enter
 UpArrow UpArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow s [ 0 ] . i d Enter    
 UpArrow Ctrl+LeftArrow Ctrl+LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow Shift+End Delete Ctrl+LeftArrow LeftArrow RightArrow Shift+Home Delete Enter     
 UpArrow Spacebar | Spacebar ? Spacebar { Spacebar D i s Backspace Backspace Backspace $ _ . Backspace Backspace Backspace Backspace Backspace n a m e Spacebar - e q Spacebar H á b i t o Enter        
 UpArrow ' Ctrl+LeftArrow ' Enter
 UpArrow Backspace Backspace Backspace Backspace Backspace Backspace Backspace � H á b i t o ' Enter
 Enter
 UpArrow Enter
 UpArrow Ctrl+LeftArrow Ctrl+LeftArrow Ctrl+LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow Shift+End Delete Enter
 UpArrow UpArrow Ctrl+LeftArrow Ctrl+LeftArrow Ctrl+LeftArrow D i s p l a y N Delete Enter
 Ctrl+LeftArrow Ctrl+LeftArrow Ctrl+LeftArrow $ _ . Ctrl+LeftArrow { Spacebar End Spacebar } Enter


### Exception

System.Text.EncoderFallbackException: Unable to translate Unicode character \\uD83D at index 33 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 Microsoft.PowerShell.PSConsoleReadLine.<>c__DisplayClass104_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, Nullable`1 lastRunStatus)

Screenshot

image

Environment data

PS Version: 7.4.6
PS HostName: Visual Studio Code Host
PSReadLine Version: 2.4.0-beta0
PSReadLine EditMode: Windows
OS: 10.0.22621.4455 (WinBuild.160101.0800)
BufferWidth: 200
BufferHeight: 23

Steps to reproduce

$userid = '[email protected]'
$lists = Get-MgUserTodoList -UserId $userid
$lists | ? { $_.DisplayName -eq '�Hábito' }

Expected behavior

Show the list

Actual behavior

Error

@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 Nov 8, 2024
@BraunerSabino
Copy link
Author

Video.mp4

@daxian-dbw
Copy link
Member

@BraunerSabino Thanks for reporting the issue. This is a duplicate of #1329

@daxian-dbw daxian-dbw added Resolution-Duplicate There's another issue on the tracker that's pretty much the same thing. and removed Needs-Triage 🔍 It's a new issue that core contributor team needs to triage. labels Nov 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution-Duplicate There's another issue on the tracker that's pretty much the same thing.
Projects
None yet
Development

No branches or pull requests

2 participants