Cant load file with non ascii characters #46159
-
Select Topic AreaQuestion BodyCant load file through github api to the repository (curl.php) with non ascii characters in name (example : 米津玄師 , — , and other non english letter). use curl like this : What could be the problem ? Maybe some headers is needed? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
|
I'm having the same problem too with using curl.exe directly, not just filename, but it will failed with error |
Beta Was this translation helpful? Give feedback.
-
|
Hello and good day @frederik123 @Ben-Mack You can try encoding the file path using the cmd /c echo "file path with non-ASCII characters" | curl -K - chcp 65001 This should properly encode the file path and allow it to be processed correctly by curl.exe |
Beta Was this translation helpful? Give feedback.
-
|
Well , i make some research and find solution. https://github.com/KnpLabs/php-github-api/blob/master/lib/Github/Api/Repository/Contents.php#L103 |
Beta Was this translation helpful? Give feedback.
Well , i make some research and find solution.
https://github.com/KnpLabs/php-github-api/blob/master/lib/Github/Api/Repository/Contents.php#L103
Need to encode file name with "rawurlencode" (https://www.php.net/manual/en/function.rawurlencode.php) .
Then file upload without problems.