A command line tool and library for transferring data with URL syntax, supporting DICT, FILE, FTP, FTPS, GOPHER, GOPHERS, HTTP, HTTPS, IMAP, IMAPS, LDAP, LDAPS, MQTT, POP3, POP3S, RTMP, RTMPS, RTSP, SCP, SFTP, SMB, SMBS, SMTP, SMTPS, TELNET, TFTP, WS and WSS. libcurl offers a myriad of powerful features
Find a file
Viktor Szakats be76b32aed
idn: clarify null-termination on Windows
Add comments to clarify that a terminating null is always present in
the buffers returned to the caller.

The curl APIs `win32_idn_to_ascii()` or `win32_ascii_to_idn()` receive
a null-terminated UTF-8 string as input. They first convert it to wide
chars by first asking `MultiByteToWideChar()` to calculate the length,
by passing -1. This API returns the length with the null char included
(= `strlen() + 1`), does the conversion, with the output also
null-terminated. `IdnTo*()` preserve this null character as documented.
Then we pass this null-terminated, fixed-length buffer ito
`WideCharToMultiByte()`, which keeps preserving the null, ending up in
the buffer returned to the caller.

Refs:
https://learn.microsoft.com/windows/win32/api/stringapiset/nf-stringapiset-multibytetowidechar
https://learn.microsoft.com/windows/win32/api/stringapiset/nf-stringapiset-widechartomultibyte
https://learn.microsoft.com/windows/win32/api/winnls/nf-winnls-idntoascii
https://learn.microsoft.com/windows/win32/api/winnls/nf-winnls-idntounicode

WINE source code:
https://gitlab.winehq.org/wine/wine/-/blob/wine-10.20/dlls/kernelbase/locale.c
https://gitlab.winehq.org/wine/wine/-/blob/wine-10.20/dlls/ntdll/locale.c
https://gitlab.winehq.org/wine/wine/-/blob/wine-10.20/dlls/ntdll/locale_private.h

Ref: https://github.com/curl/curl/pull/19976#issuecomment-3656005765
Follow-up to 6694a42aa0 #19798

Closes #19980
2025-12-16 16:30:43 +01:00
.circleci runtests: detect bad libssh differently for test 1459 (fixing CircleCI libssh job) 2025-11-16 23:28:44 +01:00
.github build: unix socket tidy-ups 2025-12-16 13:41:25 +01:00
CMake localtime: detect thread-safe alternatives and use them 2025-12-16 14:30:06 +01:00
docs lib: keep timestamp in easy handle 2025-12-16 08:48:44 +01:00
include tidy-up: miscellaneous 2025-12-12 04:18:48 +01:00
lib idn: clarify null-termination on Windows 2025-12-16 16:30:43 +01:00
LICENSES krb5: drop support for Kerberos FTP 2025-09-20 23:58:28 +02:00
m4 localtime: detect thread-safe alternatives and use them 2025-12-16 14:30:06 +01:00
packages tidy-up: miscellaneous 2025-12-12 04:18:48 +01:00
plan9 tidy-up: LibreSSL Git repository URLs and local CI builds 2025-10-01 12:55:20 +02:00
projects localtime: detect thread-safe alternatives and use them 2025-12-16 14:30:06 +01:00
scripts tidy-up: miscellaneous 2025-12-12 04:18:48 +01:00
src localtime: detect thread-safe alternatives and use them 2025-12-16 14:30:06 +01:00
tests localtime: detect thread-safe alternatives and use them 2025-12-16 14:30:06 +01:00
.dir-locals.el copyright: update all copyright lines and remove year ranges 2023-01-03 09:19:21 +01:00
.editorconfig .editorconfig: add 2025-09-02 08:36:40 +02:00
.git-blame-ignore-revs copyright: update all copyright lines and remove year ranges 2023-01-03 09:19:21 +01:00
.gitattributes winbuild: MS-DOS batch tidy-ups 2024-07-02 19:26:15 +02:00
.gitignore build: drop the winbuild build system 2025-09-20 01:20:25 +02:00
.mailmap REUSE: add copyright header to two files 2025-11-03 16:08:52 +01:00
acinclude.m4 tidy-up: miscellaneous 2025-12-12 04:18:48 +01:00
appveyor.sh tidy-up: miscellaneous 2025-12-04 20:14:11 +01:00
appveyor.yml appveyor: add support for using custom CMake versions 2025-11-28 00:51:08 +01:00
buildconf copyright: update all copyright lines and remove year ranges 2023-01-03 09:19:21 +01:00
CHANGES.md CHANGES: rename to CHANGES.md, no longer generated 2024-08-01 13:37:12 +02:00
CMakeLists.txt localtime: detect thread-safe alternatives and use them 2025-12-16 14:30:06 +01:00
configure.ac localtime: detect thread-safe alternatives and use them 2025-12-16 14:30:06 +01:00
COPYING COPYING: bump copyright year range to 1996 - 2025 2025-01-01 21:12:12 +01:00
curl-config.in autotools: tidy-up if expressions 2025-12-10 22:29:19 +01:00
Dockerfile Dockerfile: update debian:bookworm-slim digest to e899040 2025-12-09 12:40:18 +01:00
GIT-INFO.md REUSE: add copyright header to two files 2025-11-03 16:08:52 +01:00
libcurl.pc.in configure: do not echo most inherited LDFLAGS to config files 2024-11-14 09:55:45 +01:00
Makefile.am cmake: add support for libbacktrace, fix two build issues 2025-11-24 14:29:29 +01:00
README FAQ/TODO/KNOWN_BUGS: convert to markdown 2025-12-09 10:52:56 +01:00
README.md tidy-up: URLs 2025-12-09 00:19:10 +01:00
RELEASE-NOTES RELEASE-NOTES: synced 2025-12-15 07:50:51 +01:00
renovate.json renovate: try to disable GitHub Actions updates differently 2025-12-14 09:17:08 +01:00
REUSE.toml FAQ/TODO/KNOWN_BUGS: convert to markdown 2025-12-09 10:52:56 +01:00
SECURITY.md docs: Clarify OpenSSF Best Practices vs Scorecard 2024-08-22 11:50:20 +02:00

curl logo

curl is a command-line tool for transferring data from or to a server using URLs. It supports these protocols: DICT, FILE, FTP, FTPS, GOPHER, GOPHERS, HTTP, HTTPS, IMAP, IMAPS, LDAP, LDAPS, MQTT, POP3, POP3S, RTMP, RTMPS, RTSP, SCP, SFTP, SMB, SMBS, SMTP, SMTPS, TELNET, TFTP, WS and WSS.

Learn how to use curl by reading the man page or everything curl.

Find out how to install curl by reading the INSTALL document.

libcurl is the library curl is using to do its job. It is readily available to be used by your software. Read the libcurl man page to learn how.

Open Source

curl is Open Source and is distributed under an MIT-like license.

Contact

Contact us on a suitable mailing list or use GitHub issues/ pull requests/ discussions.

All contributors to the project are listed in the THANKS document.

Commercial support

For commercial support, maybe private and dedicated help with your problems or applications using (lib)curl visit the support page.

Website

Visit the curl website for the latest news and downloads.

Source code

Download the latest source from the Git server:

git clone https://github.com/curl/curl

Security problems

Report suspected security problems via our HackerOne page and not in public.

Backers

Thank you to all our backers 🙏 Become a backer.

Sponsors

Support this project by becoming a sponsor.