question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Bug: PowerShell cannot handle a file with long non-ascii file name

See original GitHub issue

Steps 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:closed
  • Created 3 years ago
  • Comments:18 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
iSazonovcommented, Jan 24, 2021

@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.

1reaction
DHowettcommented, Jan 18, 2021

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)

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found