-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Sync std{in,out,err} Encodings with Terminal
#11234
Conversation
If a `File` is in "text" mode, then it has an encoding. This encoding defaults to UTF-8; however, it can be set only at time of construction (by using `fs.open`). This modification allows the user to change the encoding on-the-fly for "text" mode `File` instances.
Do you want this to be merged as a squashed commit? If not, we still need to refer to the issue for later tracking. |
@execjosh: Regarding your side note:
Does the Terminal encoding need to match the system.std{in, out, err} encoding in order to read/write characters properly? If so, then I would definitely say "yes". If not, then I'm not certain... maybe still "yes" because you'd want that encoding setting to persist across different |
@JamesMGreene: Thank you for your input!
However, if the user changes one of Hmm... It might actually be best just not to do any syncing in either direction at all, maybe? Hmm... I guess the big problem is that |
Any opinions? |
Sorry for the late response, will have a look this evening. |
If a `File` is in "text" mode, then it has an encoding. This encoding defaults to UTF-8; however, it can be set only at time of construction (by using `fs.open`). This modification allows the user to change the encoding on-the-fly for "text" mode `File` instances. See #11234 #11234 Spin off from #11168 #11168
Merged. Thanks! |
If anyone's getting link errors after applying this, they may need to do |
Exactly! I forgot to re-run qmake :( |
See [issue 333][1] and pull request #192. **Caveat** `File::read` currently takes no parameters and is equivalent to a "`readAll`". This will be changed later to match [IO/A Spec's `Stream#read`][2]; but, should still be noted. [1]: http://code.google.com/p/phantomjs/issues/detail?id=333 [2]: http://wiki.commonjs.org/wiki/IO/A#Instance_Methods
This is a spin off from #11168.
This modification keeps the
system.std{in,out,err}
encodings in sync with theTerminal
. That is, whenever theTerminal
encoding gets changed, that update will now be propagated to theSystem
module.SIDE NOTE: Should the reverse case (propagate
system.std{in,out,err}
encoding change toTerminal
) be handled?