[w3c/FileAPI] Restore name of second argument to FileReader.readAsText (#105)

In eaf8fd9d4d64a93c8b5fddcd63d48cba923ff005 ("Cleaned up wrong TOC"), arangana made a change from `readAsText(blob[, encoding])` to `readAsText(blob[, label])` but I have not been able to find a motivation.

I'm proposing that the name `encoding` is brought back in order to clarify what the parameter does, without having to read the surrounding text in the spec.

My main motivation for filing this issue is that some documentation generators depend on the wording in this spec, which trickles down an arguably poor parameter name choice to all developers using the DOM APIs. (See https://github.com/Microsoft/TSJS-lib-generator/pull/536).

The reasoning for `encoding` specifically is:

1. It's the parameter name that had already been settled on in the spec from 2009–2013
2. It's still used by respected documentation sources (eg., [MDN](https://developer.mozilla.org/en-US/docs/Web/API/FileReader/readAsText))
3. It's arguably the most concise description of what the valid input values are (eg., `"UTF-8"`)

Here is what today's documentation looks like in Visual Studio Code (TypeScript) due to the name choice in this repository:

<img width="340" alt="screen shot 2018-07-21 at 12 55 53" src="https://user-images.githubusercontent.com/158591/43034912-87c5bf82-8ce5-11e8-91b1-7526723be5e9.png">


-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/FileAPI/issues/105

Received on Saturday, 21 July 2018 10:57:41 UTC