You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by br...@apache.org on 2014/07/24 05:48:28 UTC
svn commit: r1612989 -
/subversion/branches/svn-auth-x509/subversion/libsvn_subr/win32_xlate.c
Author: breser
Date: Thu Jul 24 03:48:27 2014
New Revision: 1612989
URL: http://svn.apache.org/r1612989
Log:
On svn-auth-x509 branch, try and get the Windows xlate code to handle UCS-2/4.
* subversion/libsvn_subr/win32_xlate.c
(get_page_id_from_name): Windows doesn't seem to know about even the IANA
character set names, so let's try just setting code page ids directly.
Modified:
subversion/branches/svn-auth-x509/subversion/libsvn_subr/win32_xlate.c
Modified: subversion/branches/svn-auth-x509/subversion/libsvn_subr/win32_xlate.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/subversion/libsvn_subr/win32_xlate.c?rev=1612989&r1=1612988&r2=1612989&view=diff
==============================================================================
--- subversion/branches/svn-auth-x509/subversion/libsvn_subr/win32_xlate.c (original)
+++ subversion/branches/svn-auth-x509/subversion/libsvn_subr/win32_xlate.c Thu Jul 24 03:48:27 2014
@@ -107,6 +107,20 @@ get_page_id_from_name(UINT *page_id_p, c
*page_id_p = CP_UTF8;
return APR_SUCCESS;
}
+ else if (!strcmp(page_name, "ISO-10646-UCS-2"))
+ {
+ *page_id_p = 1201; /* UTF-16 Big Endian, strictly speaking it isn't
+ exactly UCS-2 Big Endian but it's a superset
+ so it works well enough. */
+ return APR_SUCCESS;
+ }
+ else if (!strcmp(page_name, "ISO-10646-UCS-4"))
+ {
+ *page_id_p = 12001; /* UTF-32 Big Endian, again, it isn't strictly
+ speaking UCS-4 Big Endian, but it's a superset
+ so it works well enough. */
+ return APR_SUCCESS;
+ }
/* Use codepage identifier nnn if the codepage name is in the form
of "CPnnn".
Re: svn commit: r1612989 - /subversion/branches/svn-auth-x509/subversion/libsvn_subr/win32_xlate.c
Posted by Branko Čibej <br...@wandisco.com>.
On 24.07.2014 08:42, Ben Reser wrote:
> On 7/23/14 10:32 PM, Branko Čibej wrote:
>> Just FYI: Converting from UTF-32 is trivial, utf8proc does that all the time,
>> so you should be able to cook up something. And we already have code somewhere
>> for converting from UTF-16LE.
> I just expected that the svn_utf/xlate stuff would work. I'm still surprised
> that even after I looked up the code point identifiers for Windows it still
> isn't working.
It really depends on the version of Windows, I'm afraid ... Was it WinXP
that finally added these codepages?
> I hadn't actually considered just using utf8proc.
>
> The UTF-16LE code is svn_utf__win32_utf16_to_utf8(), which isn't exactly
> applicable since it's expecting wide characters.
"Expecting wide characters" in what sense? UTF-16 aren't wide chars. The
BE/LE variants can be dealt with at a pinch with htonl and htons ...
yucky, but should work.
-- Brane
--
Branko Čibej | Director of Subversion
WANdisco | Realising the impossibilities of Big Data
e. brane@wandisco.com
Re: svn commit: r1612989 - /subversion/branches/svn-auth-x509/subversion/libsvn_subr/win32_xlate.c
Posted by Ben Reser <be...@reser.org>.
On 7/23/14 10:32 PM, Branko Čibej wrote:
> Just FYI: Converting from UTF-32 is trivial, utf8proc does that all the time,
> so you should be able to cook up something. And we already have code somewhere
> for converting from UTF-16LE.
I just expected that the svn_utf/xlate stuff would work. I'm still surprised
that even after I looked up the code point identifiers for Windows it still
isn't working.
I hadn't actually considered just using utf8proc.
The UTF-16LE code is svn_utf__win32_utf16_to_utf8(), which isn't exactly
applicable since it's expecting wide characters.
Thanks for the additional ideas though.
Re: svn commit: r1612989 - /subversion/branches/svn-auth-x509/subversion/libsvn_subr/win32_xlate.c
Posted by Branko Čibej <br...@wandisco.com>.
On 24.07.2014 05:48, breser@apache.org wrote:
> Author: breser
> Date: Thu Jul 24 03:48:27 2014
> New Revision: 1612989
>
> URL: http://svn.apache.org/r1612989
> Log:
> On svn-auth-x509 branch, try and get the Windows xlate code to handle UCS-2/4.
>
> * subversion/libsvn_subr/win32_xlate.c
> (get_page_id_from_name): Windows doesn't seem to know about even the IANA
> character set names, so let's try just setting code page ids directly.
Just FYI: Converting from UTF-32 is trivial, utf8proc does that all the
time, so you should be able to cook up something. And we already have
code somewhere for converting from UTF-16LE.
-- Brane
--
Branko Čibej | Director of Subversion
WANdisco | Realising the impossibilities of Big Data
e. brane@wandisco.com