3 ms·
How can a server read a tag if it doesn’t know which encoding to interpret the tag in the first place?
by heavenlyblue 5y ago
How can a server read a tag if it doesn’t know which encoding to interpret the tag in the first place?
- bambax 5y agoI'm guessing, like the HTML parser does: by doing a "pre-parse". The pre-parser is yet another HTML parser, specialized on this task. This is well described in the book and this is how browsers do it today. It seems no web server ever implemented it; it would probably have been a little beneficial because each file would only need to be pre-parsed when it is written on disk (or first read by the server), instead of this being done by every client on every load. It makes me think, maybe other kinds of analysis and normalization could be done by the server, which would allow for simpler (and stricter) browsers.