Comments (4)
Encoding
is not intended to be a direct interface to the WHATWG-compatible encoding. That's why Text{En,De}coder
has a separate encoding
method. Maybe we need whatwg_name
in the future, when #4 is complete.
Regarding your examples, 1 is my mistake (shift_jis
is correct, it is a rare case of using underscores in the standardized encoding name), 2 is implemented separately in whatwg
module, and 3 is intentional and indeed it is a different encoding than EUC-KR. In fact, Shift_JIS should really have been windows-932
or windows-31j
(JIS X 0208 alone is not enough to implement it), but I'm still not decided on which standard should name
be based as no single standard covers all major encodings. For example, Windows code page 949 is missing in IANA Character Sets registration and that's why many browsers use x-windows-949
instead of a typical windows-949
. I'm even worried about encodings with the asymmetric encoder and decoder, which seems very common in WHATWG encodings for the compatibility purpose.
from rust-encoding.
Other than "get an encoding form a label" and its quirks such as mapping latin1 to windows1252, I donβt think that "WHATWG-compatible" should be a different API for the actual decoding/encoding. Or is there a reason Iβm missing that would prevent the APIs to be unified?
from rust-encoding.
@SimonSapin It is not a matter of the actual decoding/encoding, and these APIs won't be changed whatsoever. It is rather a matter of mapping the string label to the actual decoder/encoder, and in this respect WHATWG only considers Web browsers. So I think it is better to rename name
to make sure that the name is specific to WHATWG's quirks.
from rust-encoding.
ae41ef4 and 97b4005 directly fixed this issue.
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
- Community activeness
- 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.