Git Product home page Git Product logo

Comments (5)

hongooi73 avatar hongooi73 commented on June 19, 2024

Thanks for the report. Just to clarify, are you sure your filenames are UTF-8 and not a Windows charset, eg CP-1252?

from azurestor.

hongooi73 avatar hongooi73 commented on June 19, 2024

Interesting, uploading works as long as you don't specify the destination filename:

r$> bl0 <- hongstor3$get_blob_endpoint()
r$> cont1 <- blob_container(bl0, "cont1")
r$> storage_upload(cont1, "misc/abcdè.xml")
  |===============================================================================| 100%
r$> storage_upload(cont1, "misc/abcdè.xml", "abcdè.xml")
  |===============================================================================| 100%Error in process_storage_response(response, match.arg(http_status_handler),  : 
  Bad Request (HTTP 400). Failed to complete Storage Services operation. Message:
InvalidUri
The requested URI does not represent any resource on the server.

from azurestor.

hongooi73 avatar hongooi73 commented on June 19, 2024

So, this is because on Windows, strings are not encoded as UTF-8, but as Latin1 (or whatever the locale-specific codepage is). If you specify a destination filename with a non-ascii char, it gets mangled by URLencode which is called inside call_storage_endpoint:

r$> URLencode("abcdè.xml")
[1] "abcd%E8.xml"

What Azure expects is the UTF8 version, which should be

r$> URLencode(enc2utf8("abcdè.xml"))
[1] "abcd%C3%A8.xml"

The reason it works if you leave the destination out is because then it's generated with basename(src), which always outputs UTF8.

An alternative to URLencode(enc2utf8(*)) is curl::curl_escape(), which always treats strings as UTF8:

r$> curl::curl_escape("abcdè.xml")
[1] "abcd%C3%A8.xml"

from azurestor.

hongooi73 avatar hongooi73 commented on June 19, 2024

Pushed a fix in the non-ascii branch, can you try it and let me know if you run into problems?

from azurestor.

Naedri avatar Naedri commented on June 19, 2024

Hello Hongooi,

Wonderfull, thanks a lot for your quick reply.
I just downloaded the package on your non-ascii branch and it works !!!

Well done : D

PS : I am sorry to have said that my file paths were in UTF-8 whereas it is another encoding ; I should have said characters with accents
In my case, the following powershell command [System.Text.Encoding]::Default.BodyName outputs iso-8859-1

from azurestor.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.