GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — src: fix exception message encoding by mscdex · Pull Request #3288 · nodejs/node

Conversation

@mscdex

@mscdex mscdex commented Oct 8, 2015

Copy link
Copy Markdown
Contributor

The printf family of functions do not properly display UTF8 strings well on Windows. Use the appropriate wide character API instead if stderr is a tty.

Fixes: #3284

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@mscdex mscdex added c++ Issues and PRs that require attention from people who are familiar with C++. windows Issues and PRs related to the Windows platform. labels Oct 8, 2015
@mscdex

mscdex commented Oct 8, 2015

Copy link
Copy Markdown
Contributor Author

CI: https://ci.nodejs.org/view/iojs/job/node-test-pull-request/461/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@evanlucas

evanlucas commented Oct 9, 2015

Copy link
Copy Markdown
Contributor

Is it not necessary to add on https://github.com/nodejs/node/blob/master/src/node.cc#L3210?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

bnoordhuis
bnoordhuis reviewed Oct 9, 2015
View reviewed changes
Comment thread src/node.cc Outdated

@bnoordhuis bnoordhuis Oct 9, 2015

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Style issue: const char*.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@bnoordhuis

bnoordhuis commented Oct 9, 2015

Copy link
Copy Markdown
Member

This isn't complete yet, I think? There are a lot of (f)printf statements strewn throughout the code base.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@mscdex

mscdex commented Oct 9, 2015

Copy link
Copy Markdown
Contributor Author

@evanlucas That has to do with program arguments, but the string values are not from user input such that they could contain utf8.

@bnoordhuis Well, of the other printf()/fprintf() instances I could find, the string variables did not seem likely to contain utf8. If you had some specifically in mind, let me know.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@mscdex
mscdex force-pushed the fix-exception-encoding branch 2 times, most recently from 3bdc6b3 to 5d7e67a Compare October 9, 2015 17:02
@mscdex

mscdex commented Oct 9, 2015

Copy link
Copy Markdown
Contributor Author

CI again: https://ci.nodejs.org/view/iojs/job/node-test-pull-request/465/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@silverwind

silverwind commented Oct 12, 2015

Copy link
Copy Markdown
Contributor

CI is fine except the random ARM failures. I can confirm it fixes #3284.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

bnoordhuis
bnoordhuis reviewed Oct 13, 2015
View reviewed changes
Comment thread src/node.cc Outdated

@bnoordhuis bnoordhuis Oct 13, 2015

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

I'm kind of surprised this works, I thought vsnprintf() on Windows returned -1 when the output buffer is too small.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@mscdex mscdex Oct 13, 2015

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

I tested it on Windows 7 with VS2013 at least. I suppose _vscprintf() could be used instead...

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@bnoordhuis

bnoordhuis commented Oct 13, 2015

Copy link
Copy Markdown
Member

I'm going to defer to @nodejs/platform-windows.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@piscisaureus

piscisaureus commented Oct 13, 2015

Copy link
Copy Markdown
Contributor

Lgtm

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@mscdex
src: fix exception message encoding
238d1ae
The printf family of functions do not properly display UTF8
strings well on Windows. Use the appropriate wide character
API instead if stderr is a tty.

Fixes: nodejs#3284
@mscdex
mscdex force-pushed the fix-exception-encoding branch from 5d7e67a to 238d1ae Compare October 13, 2015 21:18
@mscdex

mscdex commented Oct 13, 2015

Copy link
Copy Markdown
Contributor Author

Final CI run after changing vsnprintf()->_vscprintf(): https://ci.nodejs.org/job/node-test-commit/830/

Only failures are an unrelated failure on Win10 and a recurring unrelated failure on FreeBSD 10.1 64-bit.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

mscdex added a commit that referenced this pull request Oct 13, 2015
@mscdex
src: fix exception message encoding on Windows
2d35607
The printf family of functions do not properly display UTF8
strings well on Windows. Use the appropriate wide character
API instead if stderr is a tty.

PR-URL: #3288
Fixes: #3284
Reviewed-By: Bert Belder <[email protected]>
@mscdex

mscdex commented Oct 13, 2015

Copy link
Copy Markdown
Contributor Author

Landed in 2d35607.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@mscdex mscdex closed this Oct 13, 2015
@bergus

bergus commented Oct 13, 2015

Copy link
Copy Markdown

Thanks for the quick fix!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@rvagg rvagg mentioned this pull request Oct 21, 2015
Release proposal: v5.0.0 #3466
Merged
@MylesBorins

MylesBorins commented Oct 23, 2015

Copy link
Copy Markdown
Contributor

@jasnell should this be LTS?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@jasnell jasnell added the lts-watch-v4.x label Oct 24, 2015
@jasnell

jasnell commented Oct 24, 2015

Copy link
Copy Markdown
Member

hmmm... we may need an LTS WG discussion on this one.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@jasnell

jasnell commented Oct 26, 2015

Copy link
Copy Markdown
Member

@nodejs/lts ... should we land this one in v4.x?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@rvagg rvagg mentioned this pull request Oct 28, 2015
Preparing v4.2.2 LTS Maintenance nodejs/Release#50
Closed
@rvagg

rvagg commented Oct 28, 2015

Copy link
Copy Markdown
Member

after looking at #3284 I would vote yes for this one, if this were just a "make it proper" fix then I'd be borderline but given this is fixing an actual user-reported bug it's much easier to justify because it's not academic

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@srl295 srl295 added the i18n-api Issues and PRs related to Node.js internationalization support. label Oct 28, 2015
mscdex added a commit that referenced this pull request Oct 28, 2015
@mscdex @jasnell
src: fix exception message encoding on Windows
9bffceb
The printf family of functions do not properly display UTF8
strings well on Windows. Use the appropriate wide character
API instead if stderr is a tty.

PR-URL: #3288
Fixes: #3284
Reviewed-By: Bert Belder <[email protected]>
@jasnell

jasnell commented Oct 28, 2015

Copy link
Copy Markdown
Member

Landed in v4.x-staging in 9bffceb

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@jasnell jasnell added land-on-v4.x and removed lts-watch-v4.x labels Oct 28, 2015
mscdex added a commit that referenced this pull request Oct 29, 2015
@mscdex @jasnell
src: fix exception message encoding on Windows
fe01d0d
The printf family of functions do not properly display UTF8
strings well on Windows. Use the appropriate wide character
API instead if stderr is a tty.

PR-URL: #3288
Fixes: #3284
Reviewed-By: Bert Belder <[email protected]>
@jasnell jasnell mentioned this pull request Oct 29, 2015
Release Proposal: v4.2.2 "Argon" (LTS) #3588
Closed
@jasnell jasnell removed the land-on-v4.x label Nov 3, 2015
@mscdex
mscdex deleted the fix-exception-encoding branch December 17, 2015 18:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

c++ Issues and PRs that require attention from people who are familiar with C++. i18n-api Issues and PRs related to Node.js internationalization support. windows Issues and PRs related to the Windows platform.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

10 participants

@mscdex @evanlucas @bnoordhuis @silverwind @piscisaureus @bergus @MylesBorins @jasnell @rvagg @srl295
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.