preact-components icon indicating copy to clipboard operation
preact-components copied to clipboard

Fix Unicode Encode/Decode Process

Open hhsnopek opened this issue 7 years ago • 2 comments

NOTE: the package.json edits were made by yarn/npm installation

Summary

This pull request normalizes encodings between node and the browser. By doing so we eliminate any malformed data and introduce a stable utf8 encoding/decoding library which improves stability between both environments.

Updates

  • Add utf8.js
  • Add Buffer
  • Simplify and normalize encoding/decoding process

hhsnopek avatar Feb 15 '18 01:02 hhsnopek

Codecov Report

Merging #9 into master will increase coverage by 7.14%. The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff            @@
##           master     #9      +/-   ##
========================================
+ Coverage   92.85%   100%   +7.14%     
========================================
  Files           3      1       -2     
  Lines          42     14      -28     
========================================
- Hits           39     14      -25     
+ Misses          3      0       -3
Impacted Files Coverage Δ
src/reshape-ast-to-vdom.js

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update bef6e1f...afa4360. Read the comment docs.

codecov-io avatar Feb 15 '18 01:02 codecov-io

The current tests are rather bare and should have included a larger set of Unicode characters from Unicode 6.0.0 standard. The provided solution here does work and is used in a production setting. I'm unable to allocate time to this currently, however, if I wind-up with free time in the future I can revisit this and add more tests.

hhsnopek avatar Apr 10 '18 17:04 hhsnopek