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

p_gai_strerror on Windows returns error not in UTF-8 #4716

Closed
ondj opened this issue Jul 8, 2018 · 2 comments
Closed

p_gai_strerror on Windows returns error not in UTF-8 #4716

ondj opened this issue Jul 8, 2018 · 2 comments

Comments

@ondj
Copy link

ondj commented Jul 8, 2018

Reproduction steps

Try to clone repo on Windows from not exists domain

Expected behavior

Error message is in UTF-8

Actual behavior

Error message is in bad encoding (probably UTF-16?)

failed to resolve address for not-exists-domain.test: Nen� zn�m ��dn� takov� hostitel. - this is how error message looks like after loosy transforming to UTF-8

Version of libgit2 (release number or SHA1)

771dfd1dd1c27a4693dfdfea521c07e72f456b29

Operating system(s) tested

Windows 10 with Czech locale

First was reported as https://github.com/alexcrichton/git2-rs/issues/324. I think that the problem is, that for getting error message is called method p_gai_strerror

"failed to resolve address for %s: %s", st->host, p_gai_strerror(ret));

that is translated to gai_strerror method, but the encoding is not converted like for others errors in https://github.com/libgit2/libgit2/blob/master/src/win32/error.c.

# define p_gai_strerror(c) gai_strerror(c)

@stofte
Copy link

stofte commented Dec 4, 2018

I was in this area the other day (also using git2 with VS2017), and I noticed that if you try to make cc-rs compile git2 using UNICODE. If I did this, curl broke on some missing symbols that were wchar to utf8 related, IIRC.

I ended up only specifying the runtime flags to avoid the compilation warnings from link.exe, but I left the other stuff as is. What you're seeing here might be because CURL is compiled in ANSI mode somehow. If you set CLFAGS=/DUNICODE I believe you'll see CURL wont build anymore.

@ethomson
Copy link
Member

ethomson commented Mar 9, 2024

Good news! We don’t call this function anymore, so I think the problem fixed itself. Closing this issue.

@ethomson ethomson closed this as completed Mar 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants