wxConvXXX

2 views
Skip to first unread message

Vadim Zeitlin

unread,
Nov 18, 2004, 7:41:08 AM11/18/04
to wx-dev
Hello,

I'm totally confused by now so I start a new thread to try to understand
what we need to with these wxConv objects. At the very least I think we
need to describe them in the manual and right now I'm not sure any more if
I know how to do it.

So, what is exactly wxConvLocal supposed to be? When should it be used?
wxConvFile is supposedly used for the file names (only), but why is it
different from wxConvLibc?

Could someone please help fill in the following table:

+----------------+--------+------+------+------+
|conv\platform | Win32 | GTK1 | GTK2 | OS X |
+----------------+--------+------+------+------+
|libc | | | | |
|local | | | | |
|file | | | | |
+----------------+--------+------+------+------+

Ideally in each cell we'd see how the conv is defined and also what it is
used for.

Regards,
VZ


Vaclav Slavik

unread,
Nov 18, 2004, 5:11:31 PM11/18/04
to wx-...@lists.wxwidgets.org
Ryan Norton wrote:
> I guess this (UTF8) sounds ok to me.  Anybody oppose the idea?

Why, yes, for obvious reasons: backward compatibility and the fact
that UTF-8 is not suitable for in-memory representation.

Regards,
Vaclav

--
PGP key: 0x465264C9, available from http://pgp.mit.edu/

Vadim Zeitlin

unread,
Nov 19, 2004, 10:21:23 AM11/19/04
to wx-...@lists.wxwidgets.org
On Fri, 19 Nov 2004 07:21:09 -0800 Ryan Norton <wxpro...@comcast.net> wrote:

RN> > Also, I'm far from sure how well is this going to work in practice (just
RN> > think about appending a string in one encoding to a string in another
RN> one).
RN> > This would open a whole new can of worms which we frankly don't want to
RN> > deal with.
RN>
RN> All you'd have to do is convert the operand string if it isn't the same
RN> enconding.

You can't always convert between 2 different multibyte encodings.
VZ


Vadim Zeitlin

unread,
Nov 26, 2004, 7:06:33 PM11/26/04
to wx-...@lists.wxwidgets.org
On Tue, 23 Nov 2004 16:49:37 -0500 David Elliott <ell...@stcnet.com> wrote:

DE> I'd like to just go back to my original suggestion and say that
DE> wxString in ANSI build is always in whatever format wxConvLocal is.
DE> Then I'll take it one step further and say wxConvLocal should always be
DE> whatever should be used for wxBase (which effectively means what the C
DE> library is using).

I've always agreed with this (I think). But I also believe we need a
wxConvUI to be used to convert wxString.c_str() to whatever the windowing
system expects.

Regards,
VZ


Vadim Zeitlin

unread,
Dec 1, 2004, 6:56:27 AM12/1/04
to wx-...@lists.wxwidgets.org
On Tue, 30 Nov 2004 23:44:35 -0500 David Elliott <ell...@stcnet.com> wrote:

DE> Please provide some examples of what you would actually use it for
DE> because from what I can see it would be basically useless. If you're
DE> calling a GTK API function directly (even from user code) it's obvious
DE> that you need to go to UTF-8. If you're calling a Win API function you
DE> know the encoding is already correct. If you are calling a modern
DE> Carbon or a Cocoa function you need to put the data in a CFString or
DE> NSString.

Yes, you're right, this is less useful than I thought. Still, I somehow
find the idea of having a fixed wxConvUI more tidy and it could still be
helpful both in the user code having to call platform-specific APIs (you
know by heart which encodings all wx ports use, the user might not) and in
some generic code if it needs to do something with the text and then pass
it to the native control (i.e. you could factor out the conversion in the
common code instead of doing it in the port-specific files).

But mostly it's for clarity.

Regards,
VZ


Reply all
Reply to author
Forward
0 new messages