Join GitHub today
Enable curl to work as expected on Windows #3008
Hi - I am the PM for Windows Console. Since adding curl to Windows 10 in the Windows 10 Sprint 2018 Update, we've seen and received reports of issue with Curl not behaving as expected on Windows, e.g. curl issues #731 and #345, and known-issue 5.5
I and the Windows Console Team, are in the process of overhauling Windows Console.
For example, we recently added a Pseudo Console (ConPTY) API to Windows for the first time. This API was inspired by Linux'
We're also in the process of overhauling how the Console's internal buffers store and handle Unicode, and UTF-8. In the up-coming Windows 10 Fall 2018 release, Console will be able to store and retrieve Unicode text in codepage 65001 (though it'll still struggle to display emoji, chars outside the currently selected font, etc. - that's a whole other set of issues
To accomplish the above, I hacked a couple of quick changes into my own fork of curl to enable VT-mode in the Console. when curl starts-up.
However, these changes are far from complete:
Could you steer me towards the changes you'd recommend to enable curl to light-up on Windows?
Hey @bitcrazed, this looks awesome.
Thanks @badger. Great to hear - I'll submit a PR in a moment and let the fun begin :)
Good question - we could just set the CP to 65001 at startup, but I was originally thinking to try to set the CP to more closely match the CP expressed by an HTML doc, as per W3C guidelines on encoding declaration, by looking for a
Is this overkill?
referenced this issue
Sep 18, 2018
Ah, now I get you, thanks. Okay, I see what you're saying but that's an approach we don't do on any system so it would be a first -- and quite frankly that's a route full of traps and sorry faces. I'm not convinced that road actually leads to happiness without an awful lot of work and trial and error.
So, perhaps not "overkill" but quite complicated. But of course all other approaches will mean more shortcuts and guessing with less actual input to base the guesses on...
Okay, I think we're close.
Here's what the version of curl currently shipping in Windows 10 looks like when querying http://wttr.in/seattle sans VT and UTF-8 support:
If the user is running an older version of Windows that doesn't support VT then they'll see something very similar to the first screenshot above, which is no worse than what they'll see today anyhow.
Please revert this change. Please Please Please!
@bitcrazed This is NOT right way to show unicode. You should use wide string APIs.