Commit 1a0a675
committed
fix(macos): fix can't open file by double click file in Finder and open -a in commandline
Changes:
- Add decode_file_url() function using percent_encoding crate
- Handle file:/// and file://localhost/ URL formats used by macOS
- Add percent-encoding = "2.3" to Cargo.toml (explicit dependency)
- Update Cargo.lock with percent-encoding dependency
- Add error logging for file path validation failures
This patch ensures proper decoding of URL-encoded file paths including
UTF-8 multi-byte characters (e.g., Chinese filenames) when files are
opened via `open -a markdown-viewer FILE.md` command.
The percent_encoding crate is already included as a transitive dependency
through Tauri, so this doesn't add a new dependency to the final binary.1 parent 5dc1718 commit 1a0a675
3 files changed
+32
-2
lines changedSome generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| 33 | + | |
33 | 34 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
| |||
129 | 130 | | |
130 | 131 | | |
131 | 132 | | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
132 | 158 | | |
133 | 159 | | |
134 | 160 | | |
| |||
746 | 772 | | |
747 | 773 | | |
748 | 774 | | |
749 | | - | |
750 | 775 | | |
751 | 776 | | |
752 | | - | |
| 777 | + | |
753 | 778 | | |
754 | 779 | | |
755 | 780 | | |
| |||
766 | 791 | | |
767 | 792 | | |
768 | 793 | | |
| 794 | + | |
| 795 | + | |
| 796 | + | |
769 | 797 | | |
770 | 798 | | |
771 | 799 | | |
| |||
0 commit comments