Comments (2)
I think that BOMAwareUTF8Encoding
the wrong approach. Rather, whatβs needed is what the spec calls decode.
It could be be a BOMDecoder
(or other name) that takes a "fallback encoding" parameter. When the input starts with a BOM, the BOM is stripped and the corresponding encoding is used. Otherwise, the fallback encoding is used.
This decoder should always be used for formats that support multiple encoding, because the BOM (by proximity) is more accurate than other metadata.
from rust-encoding.
@SimonSapin I have updated the description. I agree that this use case should be handled elsehow, see #19 for a separate discussion. BOM-aware encoding itself might be useful by itself though.
from rust-encoding.
Related Issues (20)
- `encoding::Encoding` cannot be shared between threads safely HOT 1
- warning: private trait in public interface (error E0445) HOT 1
- `all::encodings()` returns an errornous list (and should be sorted alphabetically). HOT 4
- Charset request: ArmSCII-8 HOT 4
- How to Reset a RawDecoder HOT 1
- Implement common traits for Encoding HOT 1
- include LICENSE text to subcrates HOT 3
- C1 are part of ISO-8859-1 (as far as the IANA is concerned)
- Use Cow?
- cp437 HOT 1
- Add Support For CP850
- Warnings emited when building
- Performance: Consider replacing lookup tables with match statements or binary search in single byte index
- request for no_std support
- Abandoned? HOT 2
- to GBK and to UTF8 is not right work
- There is no tests for rust-encoding. HOT 1
- Use FM-index & json for DBCS decoding. HOT 3
- Need the performance data for rust-encoding. HOT 1
- Issue with multi-codepoint graphemes HOT 2
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 rust-encoding.