Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix '\n' encoding #9

Merged
merged 1 commit into from Jul 6, 2015
Merged

fix '\n' encoding #9

merged 1 commit into from Jul 6, 2015

Conversation

twang3
Copy link

@twang3 twang3 commented Jun 24, 2015

No description provided.

@@ -33,7 +33,7 @@ function encode(str, charset) {
var buf = iconv.encode(str, charset);
var encodeStr = '';
for (var i = 0; i < buf.length; i++) {
encodeStr += '%' + buf[i].toString('16');
encodeStr += '%' + buf.toString('hex', i, i + 1);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's different between these two ways?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for '\n', "buf[i].toString('16')" return "a", but "buf.toString('hex', i, i + 1)" return "0a".

@fengmk2 fengmk2 merged commit f654b32 into node-modules:master Jul 6, 2015
@fengmk2
Copy link
Member

fengmk2 commented Jul 6, 2015

@twang3 Thanks!

@fengmk2 fengmk2 self-assigned this Jul 6, 2015
@fengmk2 fengmk2 added the bug label Jul 6, 2015
@fengmk2
Copy link
Member

fengmk2 commented Jul 6, 2015

1.0.1

@twang3
Copy link
Author

twang3 commented Jul 6, 2015

my pleasure!

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

Successfully merging this pull request may close these issues.

None yet

2 participants