Unhandled exception in method ReadLink(string path)
See original GitHub issueHello.
Unhandled exception throw in Avalonia.FreeDesktop.NativeMethods.ReadLink(String path).
“The output byte buffer is too small to contain the encoded data, encoding ‘Unicode (UTF-8)’ fallback ‘System.Text.EncoderReplacementFallback’.”
Input parameter: “/dev/disk/by-label/Зарезервировано\x20системой”
Maybe instead of
var symlinkMaxSize = Encoding.ASCII.GetMaxByteCount(path.Length);
use
var symlinkMaxSize = Encoding.UTF8.GetMaxByteCount(path.Length);
Thanks.
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
c# - Read text file return 'System.NotSupportedException' ...
The issue is that there is an invisible character in your string. I don't know how they get there, others have guessed that...
Read more >readlink on Windows cannot read app exec links
msg349486 ‑ (view) Author: Steve Dower (steve.dower) * Date: 2019‑08‑12 18:49
msg349499 ‑ (view) Author: Steve Dower (steve.dower) * Date: 2019‑08‑12 21:20
msg349501 ‑ (view)...
Read more >readlink - Manual
Returns the contents of the symbolic link path or false on error. Note: The function fails if path is not a symlink, except...
Read more >Python os.readlink() Method - GeekBits
The os.readlink() function takes the path to the symbolic link and returns a string representing the path to the actual file or directory....
Read more >Node.js v20.5.1 Documentation
operator <string> The operator property on the error instance. stackStartFn <Function> If provided, the generated stack trace omits frames before this function.
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

@jmacato you should use realpath instead since it already implements proper path resolving logic.
Just declare it as
Marshaller will do all of UTF8 conversions automatically without extra manual work that you were doing incorrectly anyway