Bug: PowerShell cannot handle a file with long non-ascii file name
See original GitHub issueSteps to reproduce
Create a directory named “Test” In the directory, create a file named “测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试.txt”
cd Test
ls
Expected behavior
Files listed normally.
Actual behavior
out-lineoutput: startIndex cannot be larger than length of string. (Parameter 'startIndex')
Environment data
Name Value
---- -----
PSVersion 7.0.3
PSEdition Core
GitCommitId 7.0.3
OS Microsoft Windows 10.0.20201
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
Issue Analytics
- State:
- Created 3 years ago
- Comments:18 (8 by maintainers)
Top Results From Across the Web
non-ASCII characters in Powershell scripts
I need to do some file operations in a file structure that contains special non-latin characters. Powershell crashes, when I try to use...
Read more >Understanding file encoding in VS Code and PowerShell
Encoding problems occur when the encoding of VS Code or your script file doesn't match the expected encoding of PowerShell. There is no...
Read more >Handling files in directories whose names are not entirely ...
I have run into a nasty problem that concerns directories and files with names that contain non-ASCII (UNICODE) characters on Windows.
Read more >How to create folder name or file name with special ...
The following fundamental rules enable applications to create and process valid names for files and directories, regardless of the file system:.
Read more >Delete file containing invalid characters in windows
7zip comes to my rescue - I have a PDF file that has a name that is not only long (can deal with...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

@hez2010 Do you think I can debug by means of screenshots? 😄 If you already run debugger you could review step by step 2-3 method levels and find a root of the issue.
We’ll need a backtrace or a repro outside of Terminal to be sure. A repro outside of terminal would require setting the buffer size to be the same as the window size (no scrollback history)