summaryrefslogtreecommitdiff
path: root/cygwin
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2021-09-13 06:11:00 -0600
committerYves Orton <demerphq@gmail.com>2023-02-08 15:57:31 +0800
commit841a3e1bca89544d115c2d2d3df1c96d27172a15 (patch)
tree16576f5dcb0ab728291a1f0308ec29a414b524ac /cygwin
parent2e75d796b38ec046115bbbb9a22c7a966467ade5 (diff)
downloadperl-841a3e1bca89544d115c2d2d3df1c96d27172a15.tar.gz
cygwin.c: Remove misleading comments
cygwin works on UTF-16, not UCS-2, nor UTF-8
Diffstat (limited to 'cygwin')
-rw-r--r--cygwin/cygwin.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/cygwin/cygwin.c b/cygwin/cygwin.c
index 985cc57cbe..58a86c9068 100644
--- a/cygwin/cygwin.c
+++ b/cygwin/cygwin.c
@@ -175,7 +175,6 @@ wide_to_utf8(const wchar_t *wbuf)
oldlocale = setlocale(LC_CTYPE, NULL);
setlocale(LC_CTYPE, "utf-8");
- /* uvchr_to_utf8(buf, chr) or Encoding::_bytes_to_utf8(sv, "UCS-2BE"); */
wlen = wcsrtombs(NULL, (const wchar_t **)&wbuf, wlen, NULL);
buf = (char *) safemalloc(wlen+1);
wcsrtombs(buf, (const wchar_t **)&wbuf, wlen, NULL);
@@ -203,7 +202,6 @@ utf8_to_wide(const char *buf)
setlocale(LC_CTYPE, "utf-8");
wbuf = (wchar_t *) safemalloc(wlen);
- /* utf8_to_uvchr_buf(pathname, pathname + wlen, wpath) or Encoding::_utf8_to_bytes(sv, "UCS-2BE"); */
wlen = mbsrtowcs(wbuf, (const char**)&buf, wlen, &mbs);
if (oldlocale) setlocale(LC_CTYPE, oldlocale);
@@ -315,7 +313,6 @@ XS(XS_Cygwin_win_to_posix_path)
oldlocale = setlocale(LC_CTYPE, NULL);
setlocale(LC_CTYPE, "utf-8");
- /* utf8_to_uvchr_buf(src_path, src_path + wlen, wpath) or Encoding::_utf8_to_bytes(sv, "UCS-2BE"); */
wlen = mbsrtowcs(wpath, (const char**)&src_path, wlen, &mbs);
if (wlen > 0)
err = cygwin_conv_path(what, wpath, wbuf, wlen);
@@ -323,7 +320,7 @@ XS(XS_Cygwin_win_to_posix_path)
else setlocale(LC_CTYPE, "C");
SETLOCALE_UNLOCK;
- } else { /* use bytes; assume already ucs-2 encoded bytestream */
+ } else { /* use bytes; assume already UTF-16 encoded bytestream */
err = cygwin_conv_path(what, src_path, wbuf, wlen);
}
if (err == ENOSPC) { /* our space assumption was wrong, not enough space */
@@ -408,11 +405,10 @@ XS(XS_Cygwin_posix_to_win_path)
setlocale(LC_CTYPE, "utf-8");
if (!IN_BYTES) {
mbstate_t mbs;
- /* utf8_to_uvchr_buf(src_path, src_path + wlen, wpath) or Encoding::_utf8_to_bytes(sv, "UCS-2BE"); */
wlen = mbsrtowcs(wpath, (const char**)&src_path, wlen, &mbs);
if (wlen > 0)
err = cygwin_conv_path(what, wpath, wbuf, wlen);
- } else { /* use bytes; assume already ucs-2 encoded bytestream */
+ } else { /* use bytes; assume already UTF-16 encoded bytestream */
err = cygwin_conv_path(what, src_path, wbuf, wlen);
}
if (err == ENOSPC) { /* our space assumption was wrong, not enough space */