Giter Site home page Giter Site logo

linereader's People

Contributors

luwake avatar mgmeyers avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

linereader's Issues

Problem with CSV files with UTF-8

Hello, your library is very good, but there are some problems related to character encoding and chunk size.

For example: when trying to read the string "Alimentação", it reads "Alimentaç��o".

I investigated and this problem is caused by the slice method (from FileReader).

The problem happens when the file is chunked exactly over an UTF-8 character that has more than one byte. UTF-8 characters are stored with 1 up to 4 bytes. The problem will not appear if every UTF-8 character of a text file has 1 byte (for example, English language).

But when you try to use other languages, like Latin languages or Asian languages like Japanese or Chinese, you will notice that slice() method may chunk in the middle of a UTF-8 character.

Later, when the strings are glued, they end up forming one or more invalid characters. One or more questions marks appears like in the example I gave above.

I don't think there is a solution for this, because slice() method works at byte level.

newlines are ignored in Linux

I read your code and run the demo with the test.txt attached in your repo. The result I got is
1: 12345678910, but the expected results should be:
1: 1
2: 2
3: 3
....
right? It seems the newlines are ignored. I don't know whether it is system dependent thing, I am using Linux.

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.