You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by kf...@collab.net on 2003/08/19 21:26:07 UTC

Volunteer for #872? (apr-iconv/xlate stuff, esp Win32)

Is there a Windows-and-APR-savvy developer out there, with some i18n
experience, who could pick up

   http://subversion.tigris.org/issues/show_bug.cgi?id=872

for the next milestone (0.29, on September 7th)?

Don't be scared by all the stuff at the top of the issue -- as you
read on, you'll see that much of it got resolved, and Brane lists the
remaining tasks in the issue.  His final comment says

  > --- Additional Comments From Branko Cibej 2003-04-03 12:53 PST ---
  >
  > Putting this into 0.24, bite-sized, and assigning away from myself.
  > It's really not much work, only a question of adding a couple of
  > functions and replacing some of the charset conversion calls.

He might be available to clarify what's needed, too.  But I can't
promise that, so you never heard me say it :-).

-Karl

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: Volunteer for #872? (apr-iconv/xlate stuff, esp Win32)

Posted by kf...@collab.net.
Martin Hauner <ha...@web.de> writes:
> > This is Karl in (possibly overeager) manager mode, just making sure
> > that Martin isn't waiting for answers from Brane while Brane is
> > waiting for questions from Martin.  That would be a "race condition",
> > a word that is paradoxically used to describe situations where no one
> > is going anywhere :-).
> 
> I guess that's what's happenig right now...
> 
> I had the question if my understanding of #872 (got the right
> number this time ;-) is correct.

Glad I asked, then.  You might want to resend your original questions
to Brane...

-K

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Volunteer for #872? (apr-iconv/xlate stuff, esp Win32)

Posted by Martin Hauner <ha...@web.de>.
kfogel@collab.net wrote:

> This is Karl in (possibly overeager) manager mode, just making sure
> that Martin isn't waiting for answers from Brane while Brane is
> waiting for questions from Martin.  That would be a "race condition",
> a word that is paradoxically used to describe situations where no one
> is going anywhere :-).

I guess that's what's happenig right now...

I had the question if my understanding of #872 (got the right
number this time ;-) is correct.

-- 
Martin


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Volunteer for #872? (apr-iconv/xlate stuff, esp Win32)

Posted by Martin Hauner <ha...@web.de>.
Branko Čibej wrote:
> I'm afraid you've misunderstood. You never have to convert from the
> console encoding to the native encoding. The only conversions you need
> are native<->UTF-8 (which we already have) and console<->UTF-8 (which we
> don't)

That was clear, it was just less intrusive for a first shot on
unfamiliar code to add new lines instead of modifiying existing code.
And as first step I only wanted to see if the output gets correctly
to console. Maybe it was unclear that it was not stuff for a final
solution, therefore the other questions.


-- 
Martin



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org


Re: Volunteer for #872? (apr-iconv/xlate stuff, esp Win32)

Posted by Martin Hauner <ha...@web.de>.
Branko Čibej wrote:
> I've started working on #872 anyway. It turns out that it's not
> completely trivial, and I also found potential logic errors in svn_subst
> that I'm fixing along the way.
> 
> Martin, thanks for volunteering!

uhh, ok ;)

-- 
Martin



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org


Re: Volunteer for #872? (apr-iconv/xlate stuff, esp Win32)

Posted by Branko Čibej <br...@xbc.nu>.
I've started working on #872 anyway. It turns out that it's not
completely trivial, and I also found potential logic errors in svn_subst
that I'm fixing along the way.

Martin, thanks for volunteering!

-- 
Brane Čibej   <br...@xbc.nu>   http://www.xbc.nu/brane/


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Volunteer for #872? (apr-iconv/xlate stuff, esp Win32)

Posted by Branko Čibej <br...@xbc.nu>.
Martin Hauner wrote:

> brane@xbc.nu wrote:
>
>> Here's what needs to be done with Issue #872:
>>
>>     * Define two new charset conversion functions: one that converts
>>       from the console input encoding to UTF-8, and one that converts
>>       from UTF-8 to the console output encoding. On Unix, these will
>>       just map to the existing to/from-UTF-8 functions.
>
> >     * Change the Windows portion of svn_cmdline_init to stop calling
> >       SetConsole[Outpu]CP, and instead call GetConsole[Output]CP and
> >       store both values. These will be used by the two new functions.
> >     * Use the new conversion functions wherever anything is printed to
> >       or read form the console.
>
> I have already started on something like this. I have created an
> svn_console_string_from_native method that converts a string from the
> native locale to the console codepage.

I'm afraid you've misunderstood. You never have to convert from the
console encoding to the native encoding. The only conversions you need
are native<->UTF-8 (which we already have) and console<->UTF-8 (which we
don't)

On Unix, the console encoding is always the same as the native encoding,
so you don't need any new functions. On Windows, it depends on whether
the process actually has a console or not.


-- 
Brane Čibej   <br...@xbc.nu>   http://www.xbc.nu/brane/


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Volunteer for #872? (apr-iconv/xlate stuff, esp Win32)

Posted by Branko Čibej <br...@xbc.nu>.
Ulrich Drepper wrote:

>-----BEGIN PGP SIGNED MESSAGE-----
>Hash: SHA1
>
>Martin Hauner wrote:
>
>  
>
>>+  /* where do we get the console codepage on a non Windows box? */
>>+  return APR_LOCALE_CHARSET;
>>+  //return apr_os_locale_encoding (pool);
>>    
>>
>
>return nl_langinfo (CODESET);
>
>Include <langinfo.h>.  This is UNIX mandated functionality but still
>some systems don't have it so you'll have to add configure checks.
>  
>
Nope, that's not portable. Non-Windows is not the same as Unix. :-)

Instead, you use apr_os_locale_encoding, but you don't have to do that,
because we already have functions for converting from UTF-8 to the
native encoding.


-- 
Brane Čibej   <br...@xbc.nu>   http://www.xbc.nu/brane/


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Volunteer for #872? (apr-iconv/xlate stuff, esp Win32)

Posted by Ulrich Drepper <dr...@redhat.com>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Martin Hauner wrote:

> +  /* where do we get the console codepage on a non Windows box? */
> +  return APR_LOCALE_CHARSET;
> +  //return apr_os_locale_encoding (pool);

return nl_langinfo (CODESET);

Include <langinfo.h>.  This is UNIX mandated functionality but still
some systems don't have it so you'll have to add configure checks.

- -- 
- --------------.                        ,-.            444 Castro Street
Ulrich Drepper \    ,-----------------'   \ Mountain View, CA 94041 USA
Red Hat         `--' drepper at redhat.com `---------------------------
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQE/X54W2ijCOnn/RHQRArNaAJ9hRJc4Ew4BCKEpz84/5kROSwyE7gCeIddY
bq12X2l2ToPC+e1fAStUZgY=
=XQV9
-----END PGP SIGNATURE-----


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Volunteer for #872? (apr-iconv/xlate stuff, esp Win32)

Posted by Martin Hauner <ha...@web.de>.
brane@xbc.nu wrote:

> Here's what needs to be done with Issue #872:
> 
>     * Define two new charset conversion functions: one that converts
>       from the console input encoding to UTF-8, and one that converts
>       from UTF-8 to the console output encoding. On Unix, these will
>       just map to the existing to/from-UTF-8 functions.
 >     * Change the Windows portion of svn_cmdline_init to stop calling
 >       SetConsole[Outpu]CP, and instead call GetConsole[Output]CP and
 >       store both values. These will be used by the two new functions.
 >     * Use the new conversion functions wherever anything is printed to
 >       or read form the console.

I have already started on something like this. I have created an 
svn_console_string_from_native method that converts a string from the 
native locale to the console codepage. It gets the codepage from this
method:

+const char* svn_console_get_output_cp ( apr_pool_t *pool )
+{
+#ifdef SVN_WIN32
+
+  UINT cp = GetConsoleOutputCP ();
+  return apr_psprintf (pool, "%d", cp);
+
+#else
+
+  /* where do we get the console codepage on a non Windows box? */
+  return APR_LOCALE_CHARSET;
+  //return apr_os_locale_encoding (pool);
+
+#endif
+}

I copied most of the xlate stuff from libsvn_subr/utf.c. Its the same 
code, just a different code page to convert to.

Now the question is, is the stuff from utf.c used elsewhere or is
it just used for converting input to utf8 and utf8 to output?

If it is only used for input/output conversion it would be enough
to modify utf.c to use a method like svn_console_get_output_cp to get 
its source/destination codepage.

There is another question. I have noticed that if I add 8-bit
characters to the printf statements (I played with the 
log_message_receiver in cmd-log.c) their output on the console is
wrong too. Maybe its worth to create a c(onsole)printf method that
would do the console conversion and then call printf.
This way If I want to print something to the console I just call
cprintf and I wouldn't need extra calls to take care of the conversion.


-- 
Martin


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Volunteer for #872? (apr-iconv/xlate stuff, esp Win32)

Posted by br...@xbc.nu.
kfogel@collab.net wrote:

>Martin Hauner <ha...@web.de> writes:
>  
>
>>Hi, I am not an expert on those stuff but I would give it a try.
>>    
>>
>
>Hello, Martin and Brane.
>
>This is Karl in (possibly overeager) manager mode, just making sure
>that Martin isn't waiting for answers from Brane while Brane is
>waiting for questions from Martin.  That would be a "race condition",
>a word that is paradoxically used to describe situations where no one
>is going anywhere :-).
>
>So: you guys are coordinated, and know whose court the ball is in for
>issue #872?
>
>-Karl, former Co-Tyrant, now ESPN Commentator for SubversionBall
>
>  
>

Sorry for the extremely late reply... I've been so busy it's not even
funny any more.

Here's what needs to be done with Issue #872:

    * Define two new charset conversion functions: one that converts
      from the console input encoding to UTF-8, and one that converts
      from UTF-8 to the console output encoding. On Unix, these will
      just map to the existing to/from-UTF-8 functions.
    * Change the Windows portion of svn_cmdline_init to stop calling
      SetConsole[Outpu]CP, and instead call GetConsole[Output]CP and
      store both values. These will be used by the two new functions.
    * Use the new conversion functions wherever anything is printed to
      or read form the console.

It's also a good idea to be careful about the usage of
svn_utf_utf8_to_native; it's possible that this function can be mapped
directly to the new console output conversion routine, but I'm not
positive as I haven't looked at the code yet.


Hope that's clear enough.


-- 
Brane Čibej   <br...@xbc.nu>   http://www.xbc.nu/brane/


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Volunteer for #872? (apr-iconv/xlate stuff, esp Win32)

Posted by kf...@collab.net.
Martin Hauner <ha...@web.de> writes:
> Hi, I am not an expert on those stuff but I would give it a try.

Hello, Martin and Brane.

This is Karl in (possibly overeager) manager mode, just making sure
that Martin isn't waiting for answers from Brane while Brane is
waiting for questions from Martin.  That would be a "race condition",
a word that is paradoxically used to describe situations where no one
is going anywhere :-).

So: you guys are coordinated, and know whose court the ball is in for
issue #872?

-Karl, former Co-Tyrant, now ESPN Commentator for SubversionBall

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Volunteer for #872? (apr-iconv/xlate stuff, esp Win32)

Posted by kf...@collab.net.
Martin Hauner <ha...@web.de> writes:
> Hi, I am not an expert on those stuff but I would give it a try.
> 
> As I understand #782:
> - remove the SetConsoleCP stuff from cmdline.c:svn_cmdline_init
> - write a subroutine that converts the console input GetConsoleCP()
>    to GetCP() and one that converts GetCP() to GetConsoleCP() using
>    apr_iconv.
> - replace reads/writes from/to the console with the new subroutines.
> 
> Is this anywhere near to what #782 is about?
                                 ^^^

No, but it might be what #872 is about :-).  Brane can answer better
than I.

Thanks for jumping in, Martin!

-Karl

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Volunteer for #872? (apr-iconv/xlate stuff, esp Win32)

Posted by Martin Hauner <ha...@web.de>.
kfogel@collab.net wrote:

> Branko Čibej <br...@xbc.nu> writes:
> 
>>>He might be available to clarify what's needed, too.  But I can't
>>>promise that, so you never heard me say it :-).
>>
>>*I* heard you.
>>
>>Yes, I can explain what needs doing, but won't have much time to
>>actually write the code. Can review patches, if people are patient
>>enough to give me time to get at them.
> 
> 
> Thanks!
> 
> Now to wait hopefully for someone else to respond as well...

Hi, I am not an expert on those stuff but I would give it a try.

As I understand #782:
- remove the SetConsoleCP stuff from cmdline.c:svn_cmdline_init
- write a subroutine that converts the console input GetConsoleCP()
   to GetCP() and one that converts GetCP() to GetConsoleCP() using
   apr_iconv.
- replace reads/writes from/to the console with the new subroutines.

Is this anywhere near to what #782 is about?

-- 
Martin


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org


Re: Volunteer for #872? (apr-iconv/xlate stuff, esp Win32)

Posted by kf...@collab.net.
Branko Čibej <br...@xbc.nu> writes:
> >He might be available to clarify what's needed, too.  But I can't
> >promise that, so you never heard me say it :-).
>
> *I* heard you.
> 
> Yes, I can explain what needs doing, but won't have much time to
> actually write the code. Can review patches, if people are patient
> enough to give me time to get at them.

Thanks!

Now to wait hopefully for someone else to respond as well...

(Purists who complain that the word "hopefully" is almost always
misused will note that above it is used in the sense that they wish it
would always be used in.  Oops, I ended the previous sentence with a
preposition; hopefully I'll be more careful next time.)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org


Re: Volunteer for #872? (apr-iconv/xlate stuff, esp Win32)

Posted by kf...@collab.net.
Branko Čibej <br...@xbc.nu> writes:
> >He might be available to clarify what's needed, too.  But I can't
> >promise that, so you never heard me say it :-).
>
> *I* heard you.
> 
> Yes, I can explain what needs doing, but won't have much time to
> actually write the code. Can review patches, if people are patient
> enough to give me time to get at them.

Thanks!

Now to wait hopefully for someone else to respond as well...

(Purists who complain that the word "hopefully" is almost always
misused will note that above it is used in the sense that they wish it
would always be used in.  Oops, I ended the previous sentence with a
preposition; hopefully I'll be more careful next time.)

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org


Re: Volunteer for #872? (apr-iconv/xlate stuff, esp Win32)

Posted by Branko Čibej <br...@xbc.nu>.
kfogel@collab.net wrote:

>Is there a Windows-and-APR-savvy developer out there, with some i18n
>experience, who could pick up
>
>   http://subversion.tigris.org/issues/show_bug.cgi?id=872
>
>for the next milestone (0.29, on September 7th)?
>
>Don't be scared by all the stuff at the top of the issue -- as you
>read on, you'll see that much of it got resolved, and Brane lists the
>remaining tasks in the issue.  His final comment says
>
>  > --- Additional Comments From Branko Cibej 2003-04-03 12:53 PST ---
>  >
>  > Putting this into 0.24, bite-sized, and assigning away from myself.
>  > It's really not much work, only a question of adding a couple of
>  > functions and replacing some of the charset conversion calls.
>
>He might be available to clarify what's needed, too.  But I can't
>promise that, so you never heard me say it :-).
>
*I* heard you.

Yes, I can explain what needs doing, but won't have much time to
actually write the code. Can review patches, if people are patient
enough to give me time to get at them.


-- 
Brane Čibej   <br...@xbc.nu>   http://www.xbc.nu/brane/


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Volunteer for #872? (apr-iconv/xlate stuff, esp Win32)

Posted by Branko Čibej <br...@xbc.nu>.
kfogel@collab.net wrote:

>Is there a Windows-and-APR-savvy developer out there, with some i18n
>experience, who could pick up
>
>   http://subversion.tigris.org/issues/show_bug.cgi?id=872
>
>for the next milestone (0.29, on September 7th)?
>
>Don't be scared by all the stuff at the top of the issue -- as you
>read on, you'll see that much of it got resolved, and Brane lists the
>remaining tasks in the issue.  His final comment says
>
>  > --- Additional Comments From Branko Cibej 2003-04-03 12:53 PST ---
>  >
>  > Putting this into 0.24, bite-sized, and assigning away from myself.
>  > It's really not much work, only a question of adding a couple of
>  > functions and replacing some of the charset conversion calls.
>
>He might be available to clarify what's needed, too.  But I can't
>promise that, so you never heard me say it :-).
>
*I* heard you.

Yes, I can explain what needs doing, but won't have much time to
actually write the code. Can review patches, if people are patient
enough to give me time to get at them.


-- 
Brane Čibej   <br...@xbc.nu>   http://www.xbc.nu/brane/


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org