Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Document the encoding used for stdout #7159

Closed
jroper opened this issue Feb 21, 2014 · 8 comments
Closed

Document the encoding used for stdout #7159

jroper opened this issue Feb 21, 2014 · 8 comments

Comments

@jroper
Copy link

jroper commented Feb 21, 2014

I'm writing a tool that invokes node, but I need to know what encoding it uses to convert Strings to bytes when you write them to stdout either through process.stdout or console.log, so that when I read them, I can use the correct encoding to transform the byte streams back to Strings. Is it the platform default encoding, is it hard coded to UTF-8, can it be overridden in any way? I couldn't find anywhere in the documentation that mentions this, which seems like a pretty important thing to document.

@indutny
Copy link
Member

indutny commented Feb 21, 2014

I'm +1 for adding method to changing default encoding on a writable stream. @tjfontaine or @trevnorris any objections? Right now the only way to do it is process.stdout._writableState.defaultEncoding = '...'.

@trevnorris
Copy link

I'm not opposed.

@indutny
Copy link
Member

indutny commented Feb 22, 2014

@jroper do you have any interest in contributing to node? ;)

recursivefunk pushed a commit to recursivefunk/node that referenced this issue Sep 3, 2014
Added a method to change and retrieve the
default encoding for writable streams.

Fixes nodejs#7159
@recursivefunk
Copy link

Opened a PR for this

@jroper
Copy link
Author

jroper commented Sep 4, 2014

Ha, I missed that comment made in February.

I was thinking... what if node was implemented in Scala...

@recursivefunk
Copy link

You sir, are brave lol @jroper

recursivefunk pushed a commit to recursivefunk/node that referenced this issue Sep 5, 2014
Default encoding for writable streams.

Added a method to change and retrieve the
default encoding for writable streams.

Fixes nodejs#7159

Default encoding for writable streams.

This commit adds a method for setting and retriving
the default encoding for writable streams.

Fixes 7159
@recursivefunk
Copy link

Sorry for all the updates @indutny

recursivefunk pushed a commit to recursivefunk/node that referenced this issue Sep 23, 2014
recursivefunk pushed a commit to recursivefunk/node that referenced this issue Sep 25, 2014
recursivefunk pushed a commit to recursivefunk/node that referenced this issue Sep 30, 2014
recursivefunk pushed a commit to recursivefunk/node that referenced this issue Oct 1, 2014
recursivefunk pushed a commit to recursivefunk/node that referenced this issue Oct 1, 2014
recursivefunk pushed a commit to recursivefunk/node that referenced this issue Oct 2, 2014
This commit adds the ability to set the default
encoding for writable streams.

Fixes nodejs#7159
recursivefunk pushed a commit to recursivefunk/node that referenced this issue Oct 7, 2014
This commit adds the ability to set the default
encoding for writable streams.

Fixes nodejs#7159
trevnorris pushed a commit that referenced this issue Oct 8, 2014
Add API Writable#setDefaultEncoding().

PR-URL: #8483
Fixes: #7159
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
@trevnorris
Copy link

Fixed by f04f3a0.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants