You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Ryan Schmidt <su...@ryandesign.com> on 2010/03/18 10:33:21 UTC

Re: Cannot accept 'svn:sync-lock' property because it is not encoded in UTF-8

On Mar 18, 2010, at 03:47, Dmitry Savvateev wrote:

> Yes, indeed, the host name contained cyrillics. I changed it, and the
> problem disappeared.
> 
> I think, the host name was automatically generated by the system
> (sounded like "user-pc" in Russian). That means the problem may be
> rather common, and it makes sense to encode hostname in UTF-8 before
> using as lock text.

If your hostname is not UTF-8, how is Subversion to know what character encoding it's using? It seems to me it's a bug (of your OS) to present a non-UTF-8 string (or possibly even a non-ASCII string) as a valid hostname. (My thought is that if a non-ASCII hostname is desired, the UTF-8 representation of the hostname should be encoded in punycode [1] by the OS. But maybe that's just me.)


[1] http://en.wikipedia.org/wiki/Punycode


Re: Cannot accept 'svn:sync-lock' property because it is not encoded in UTF-8

Posted by Daniel Shahaf <d....@daniel.shahaf.name>.
Ryan Schmidt wrote on Thu, 18 Mar 2010 at 05:33 -0500:
> If your hostname is not UTF-8, how is Subversion to know what
> character encoding it's using? It seems to me it's a bug (of your OS)
> to present a non-UTF-8 string (or possibly even a non-ASCII string) as
> a valid hostname.

We get the hostname from APR.  Either Subversion or APR (depending on 
APR's API promises) should convert it to UTF-8 (or, as you say, punycode) 
before we attempt to use it as the property value.

Another option: we could use the local IP address instead of the hostname.

> (My thought is that if a non-ASCII hostname is
> desired, the UTF-8 representation of the hostname should be encoded in
> punycode [1] by the OS. But maybe that's just me.)
> 
> 
> [1] http://en.wikipedia.org/wiki/Punycode
> 
> 
> 

Re: Cannot accept 'svn:sync-lock' property because it is not encoded in UTF-8

Posted by Dmitry Savvateev <ds...@mail.ru>.
hostname is irrelevant for those not using their PCs as servers (like
me). I've been using this computer (with this hostname) for about a
year without any problems. It was used for Internet access, but only
client side.

AFAIK, Windows has a notion of "ansi" encoding, which is a single-byte
encoding for the local language used by the system  (cp1251 in my
case). There are also set of "parallel" APIs returning Unicode strings
in UTF-16. May be these should be used instead, I don't know.


2010/3/18 Ryan Schmidt <su...@ryandesign.com>:
>
> On Mar 18, 2010, at 03:47, Dmitry Savvateev wrote:
>
>> Yes, indeed, the host name contained cyrillics. I changed it, and the
>> problem disappeared.
>>
>> I think, the host name was automatically generated by the system
>> (sounded like "user-pc" in Russian). That means the problem may be
>> rather common, and it makes sense to encode hostname in UTF-8 before
>> using as lock text.
>
> If your hostname is not UTF-8, how is Subversion to know what character encoding it's using? It seems to me it's a bug (of your OS) to present a non-UTF-8 string (or possibly even a non-ASCII string) as a valid hostname. (My thought is that if a non-ASCII hostname is desired, the UTF-8 representation of the hostname should be encoded in punycode [1] by the OS. But maybe that's just me.)
>
>
> [1] http://en.wikipedia.org/wiki/Punycode
>
>