Re: [whatwg/encoding] gb18030 encoder using index gb18030 ranges pointer (#258)

I'm sorry for my lack of precision. At the beginning of my post I've included some ``irreversible'' codes as an example of such ``irreversibility''. I agree that only surrogates (among all strange codes) pass to that point at the moment. It is not a problem: they are denied already by an assertion at **process an item**.

I'm rather wondering about some kind of protection from inconsistencies of two data files (or promise of consistency). Potential holes at pointer => code point are explicitly eliminated by **gb18030 decoder**, next at **index gb18030 ranges code point** and finally while looking at index-gb18030-ranges.txt description.

If we consider code point => pointer direction (encoding) there is no obvious way to state a consistency. Especially the standard says: we are using two files for [only/primarily] space saving purposes. At the first view we have 1:1 map and next not always reversible function for remnants. It rings the bell: ``what if some irreversible value passed?'' (those bells in my head when I'm returning to the standard every time ;-).

I know that an adding my verification is too heavy and unnecessary. But please consider some light-weight solution: maybe your short and concise sentence ``It only uses...'' as a note after point 7. in **gb18030 encoder**; some comment at index table description or so. Thank you for your answer and time.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/encoding/issues/258#issuecomment-831498635

Received on Monday, 3 May 2021 20:01:55 UTC