Coder Social home page Coder Social logo

Comments (6)

breunigs avatar breunigs commented on June 28, 2024

As suspected, onedrive encodes the en dash on the simple upload response. Relevant excerpt:

"name":"lets test en dashes \u2013 small file.txt"

from onedrive.

breunigs avatar breunigs commented on June 28, 2024

more specifically, the en dash is represented in the ubyte[] as 226 128 147 in decimal or 11100010 10000000 10010011 in binary, which looks like valid encoding as far as I can tell.

from onedrive.

breunigs avatar breunigs commented on June 28, 2024

Changing the type of ubyte[] content to char[] works without any other changes, although I'm not sure why D allows concatenation of different types. The example for http.onReceive actively converts instead.

Is either of these idiomatic?

from onedrive.

skilion avatar skilion commented on June 28, 2024

Thanks for the detailed report.
Your suggested fix is correct (32009e2). As soon as content is typed as char[], it is treated as an UTF-8 string and all code points can be iterated correctly.

from onedrive.

breunigs avatar breunigs commented on June 28, 2024

thanks!

from onedrive.

skilion avatar skilion commented on June 28, 2024

I asked on the D forum why the concatenation of different types is allowed (assignation doesn't work). The reason is that concatenation works by appending each element from the source to the destination, in this case the types involved are implicitly convertible into one another (ubyte -> char) therefore the concatenation is allowed.

from onedrive.

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.