Giter VIP home page Giter VIP logo

Comments (7)

peterflynn avatar peterflynn commented on August 10, 2024

I think this bug actually cuts across brackets + brackets-app. It appears that our impl of fs.readFile() (and thus also FileReader.readAsText()) is wrong; it errors out on Mac when trying to read binary data when it should actually return some sort of (garbled) string. Our UI code is also wrong because it determines whether a file is openable or not by expecting this (erroneous) error signal... which means on Win, where the APIs work the way they're supposed to, the UI proceeds to open the garbled text instead of showing an error.

from brackets-app.

jlondon avatar jlondon commented on August 10, 2024

We should fix this in sprint 3 - adding label.

from brackets-app.

redmunds avatar redmunds commented on August 10, 2024

It's relatively easy to determine if a file is ASCII or not, but when you start considering UTF-8, UTF-16, and other encodings, it's not easy to determine. Take a look at the algorithm discussed in this post:
http://stackoverflow.com/questions/277521/how-to-identify-the-file-content-is-in-ascii-or-binary

Some of our competitors determine this, at some level, anyway, but others display garbage as we currently do.

Should this be required for Sprint3? Which types of text should we detect?

from brackets-app.

gruehle avatar gruehle commented on August 10, 2024

Could we do a simple extension check for now? Eventually, if (when?) we show image previews in Brackets, we'll need to be looking at file extensions anyway.

from brackets-app.

jlondon avatar jlondon commented on August 10, 2024

I agree with Glenn's suggestion. That's basically what Dreamweaver does. It has a table of file extensions it knows it can't open and if the file extension isn't on that list, it tries to open it. The algorithm approach sounds like it might be expensive.

from brackets-app.

redmunds avatar redmunds commented on August 10, 2024

The DW approach is acceptable because that list can easily be updated via DW preferences. But there is a group of developers (not sure how large) that like to use files with no file extensions which is not possible in DW.

from brackets-app.

jlondon avatar jlondon commented on August 10, 2024

Closing and moving to the Product Backlog.

from brackets-app.

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.