Comments (7)
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.
We should fix this in sprint 3 - adding label.
from brackets-app.
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.
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.
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.
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.
Closing and moving to the Product Backlog.
from brackets-app.
Related Issues (20)
- Load Project is slow when a file is in the working set HOT 2
- File is not restored when not in working set (Win / Mac ) HOT 1
- White line separates menu bar from UI HOT 3
- Saving a file in Brackets corrupts the file. HOT 2
- Brackets doesn't remember current file if not in the working set HOT 6
- Unnecessary scroll bars show up in working set after closing an updated file w/o saving it. HOT 1
- No key events sent for modifier keys on Mac HOT 3
- Tooltips don't display on Mac HOT 2
- Linux version of the app HOT 7
- Cannot double-click folder to select in Open Folder dialog HOT 4
- Redirect to friendly error page if brackets/index.html is missing HOT 3
- Incorrect default encoding in FileReader.readAsText HOT 1
- Unexpected Chrome location can prevent live preview from working on PC HOT 1
- [Sprint9] better installation instructions/build HOT 2
- DON'T FILE BUGS HERE--file them in https://github.com/adobe/brackets/issues HOT 4
- (o^o) HOT 1
- test
- test 2
- Brackets on Windows hangs when scrolling the contents of a binary file HOT 1
- Mac only: When Brackets is minimized ALT+CMD+I doesn't bring up the Dev Tools HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from brackets-app.