Login | Register
My pages Projects Community openCollabNet

Discussions > dev [DISABLED] > Re: [PATCH] Remove APR ICONV dependency on Windows (was SVN Win32 Developers -- need some help)

subversion
Discussion topic

Back to topic list

Re: [PATCH] Remove APR ICONV dependency on Windows (was SVN Win32 Developers -- need some help)

Author chemodax
Full name deleted
Date 2007-07-02 04:07:15 PDT
Message On 7/1/07, Stefan Küng <tortoisesvn at gmail dot com> wrote:
> Ivan Zhakov wrote:
> > On 7/1/07, steveking <tortoisesvn at gmail dot com> wrote:
> >> Ivan Zhakov wrote:
> >>
> >> > Sorry, I was busy and I have not time to report my research results.
> >> >
> >> > My patch almost complete and I need somebody's eyes to look and
> >> > confirm that I'm on right way (or say that I'm on wrong way :)
> >> >
> >> > I used Windows MIME database to convert page name to Windows page
> >> > identifier.
> >> > And most important question is it acceptable to read Windows MIME
> >> > database directly from registry instead of using MLang API [1]? I
> >> > didn't use MLang API, because it requires
> >> > CoInitialize()/CoUni​nitialize().
> >>
> >> I think it would be better to use the API instead of reading the
> >> registry. Because the registry is not documented and could change any
> >> time.
> >> About CoInitialize(): we could call that in svn_utf_initialize() and
> >> call CoUninitialize in an apr cleanup handler.
> > Actually registry is documented, at least for Windows CE :)
> > I agree that using API is better, but it's not too easy. We have to
> > call CoInitalize() in each thread that using COM. Another problem that
> > we don't require user libraries to call svn_utf8_initalize().
> >
> > As workaround of problems above we can call to
> > CoInitialize()/CoUninitalize() every time in win32_open_xlate(). This
> > function get called only once for each page identifiers, so it
> > shouldn't cause performance degradation. What do you think about it?
>
> I forgot about the backward compatibility. Otherwise we could just
> document that CoInitialize() must be called for every thread.
>
> If the registry is documented, then we can of course use that. I don't
> think it will be faster than using the API since registry accesses are
> expensive too, but at least for most conversions it's not needed anyway.
>
Here is revisited patch. Major vhanges from previous version:
- Use MLang API for converting page name to page id.
- All Windows stuff moved to separate file win32_xlate.c.

[[[
Remove APR ICONV dependency on Windows and use native Windows
character conversion API (MultiByteToWideChar​/WideCharToMultiByte​).

* subversion/tests/lib​svn_subr/utf-test.c
  (test_utf_cstring_to_utf8_ex2): New test for conversion from
different codepages
  to utf8.
  (test_utf_cstring_fr​om_utf8_ex2): New test for conversion to
different codepages
  from utf8.
  (test_funcs): Add two tests.

* subversion/libsvn_subr/utf8.c
  (get_xlate_handle_node): Use svn_subr__win32_xlate_open() on Windows.
  (convert_to_stringbuf): Use svn_subr__win32_conv​ert_to_stringbuf() on Windows.

* subversion/libsvn_su​br/win32_xlate.c
* subversion/libsvn_su​br/win32_xlate.h
  (win32_xlate_t): Structure for holding Windows xlate data.
  (get_page_id_from_name): Helper for converting page name to page identifier.
  (svn_subr__win32_xlate_open): Opens Windows xlate to convert one codepage to
  another.
  (svn_subr__win32_con​vert_to_string_buf):​ Converts string from one codepage to
  another using Windows API.
]]]

--
Ivan Zhakov
Attachments

« Previous message in topic | 20 of 35 | Next message in topic »

Messages

Show all messages in topic

[PATCH] Remove APR ICONV dependency on Windows (was SVN Win32 Developers -- need some help) chemodax deleted 2007-06-30 14:45:41 PDT
     Re: [PATCH] Remove APR ICONV dependency on Windows (was SVN Win32 Developers -- need some help) djh D.J. Heap 2007-06-30 19:18:41 PDT
         Re: [PATCH] Remove APR ICONV dependency on Windows (was SVN Win32 Developers -- need some help) djh D.J. Heap 2007-06-30 19:43:51 PDT
             Re: [PATCH] Remove APR ICONV dependency on Windows (was SVN Win32 Developers -- need some help) chemodax deleted 2007-06-30 23:58:44 PDT
                 Re: [PATCH] Remove APR ICONV dependency on Windows (was SVN Win32 Developers -- need some help) djh D.J. Heap 2007-07-01 06:06:02 PDT
                     Re: [PATCH] Remove APR ICONV dependency on Windows (was SVN Win32 Developers -- need some help) Daniel Rall <dlr at collab dot net> Daniel Rall <dlr at collab dot net> 2007-07-03 09:58:00 PDT
                         Re: [PATCH] Remove APR ICONV dependency on Windows (was SVN Win32 Developers -- need some help) djh D.J. Heap 2007-07-04 07:48:13 PDT
             Re: [PATCH] Remove APR ICONV dependency on Windows (was SVN Win32 Developers -- need some help) chemodax deleted 2007-07-05 12:48:46 PDT
                 Re: [PATCH] Remove APR ICONV dependency on Windows (was SVN Win32 Developers -- need some help) djh D.J. Heap 2007-07-05 13:21:09 PDT
                     Re: [PATCH] Remove APR ICONV dependency on Windows (was SVN Win32 Developers -- need some help) Mark Phippard <markphip at gmail dot com> Mark Phippard <markphip at gmail dot com> 2007-07-05 13:23:59 PDT
                 Re: [PATCH] Remove APR ICONV dependency on Windows (was SVN Win32 Developers -- need some help) djh D.J. Heap 2007-07-07 08:31:40 PDT
                     Re: [PATCH] Remove APR ICONV dependency on Windows (was SVN Win32 Developers -- need some help) chemodax deleted 2007-07-07 15:32:02 PDT
                         Re: [PATCH] Remove APR ICONV dependency on Windows (was SVN Win32 Developers -- need some help) chemodax deleted 2007-07-07 15:47:49 PDT
                             Re: [PATCH] Remove APR ICONV dependency on Windows (was SVN Win32 Developers -- need some help) djh D.J. Heap 2007-07-07 18:47:34 PDT
                                 Re: [PATCH] Remove APR ICONV dependency on Windows (was SVN Win32 Developers -- need some help) chemodax deleted 2007-07-08 01:06:47 PDT
                         Re: [PATCH] Remove APR ICONV dependency on Windows (was SVN Win32 Developers -- need some help) djh D.J. Heap 2007-07-07 18:32:05 PDT
     Re: [PATCH] Remove APR ICONV dependency on Windows (was SVN Win32 Developers -- need some help) steveking Stefan Küng 2007-07-01 00:13:50 PDT
         Re: [PATCH] Remove APR ICONV dependency on Windows (was SVN Win32 Developers -- need some help) chemodax deleted 2007-07-01 08:31:56 PDT
             Re: [PATCH] Remove APR ICONV dependency on Windows (was SVN Win32 Developers -- need some help) steveking Stefan Küng 2007-07-01 08:52:52 PDT
                 Re: [PATCH] Remove APR ICONV dependency on Windows (was SVN Win32 Developers -- need some help) chemodax deleted 2007-07-02 04:07:15 PDT
                     Re: [PATCH] Remove APR ICONV dependency on Windows (was SVN Win32 Developers -- need some help) djh D.J. Heap 2007-07-02 20:49:17 PDT
                         Re: [PATCH] Remove APR ICONV dependency on Windows (was SVN Win32 Developers -- need some help) chemodax deleted 2007-07-05 02:11:42 PDT
                             Re: [PATCH] Remove APR ICONV dependency on Windows (was SVN Win32 Developers -- need some help) Mark Phippard <markphip at gmail dot com> Mark Phippard <markphip at gmail dot com> 2007-07-05 05:58:48 PDT
                                 Re: [PATCH] Remove APR ICONV dependency on Windows (was SVN Win32 Developers -- need some help) chemodax deleted 2007-07-05 06:07:05 PDT
                                 Re: [PATCH] Remove APR ICONV dependency on Windows (was SVN Win32 Developers -- need some help) steveking Stefan Küng 2007-07-05 06:10:53 PDT
Page: of 2 « Previous | Next »
Messages per page: