svn commit: r1934438 - subversion/trunk/subversion/libsvn_subr

[email protected]
Newsgroups gmane.comp.version-control.subversion.svn
Message-ID <177928998838.1258326.8241216208460644241@svn03-he-fi>
Author: ivan
Date: Wed May 20 15:13:08 2026
New Revision: 1934438

Log:
Make `svn --version -v` report "UTF-8" instead of "CP65001" when UTF-8
encoding is used.

Similar to r1934354 in APR.

* subversion/libsvn_subr/win32_xlate.c
  (svn_subr__win32_xlate_locale_encoding): Return "UTF-8" for CP_UTF8 (65001).

Modified:
   subversion/trunk/subversion/libsvn_subr/win32_xlate.c

Modified: subversion/trunk/subversion/libsvn_subr/win32_xlate.c
==============================================================================
--- subversion/trunk/subversion/libsvn_subr/win32_xlate.c	Wed May 20 15:07:02 2026	(r1934437)
+++ subversion/trunk/subversion/libsvn_subr/win32_xlate.c	Wed May 20 15:13:08 2026	(r1934438)
@@ -266,7 +266,15 @@ svn_subr__win32_xlate_locale_encoding(ap
 
   if (GetCPInfoExW(CP_THREAD_ACP, 0, &cpinfo))
     {
-      return apr_psprintf(pool, "CP%u", (unsigned int)cpinfo.CodePage);
+      DWORD codepage = cpinfo.CodePage;
+      if (codepage == CP_UTF8)
+        {
+          return "UTF-8";
+        }
+      else
+        {
+          return apr_psprintf(pool, "CP%u", (unsigned int)cpinfo.CodePage);
+        }
     }
   else
     {
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.