Change codepage - OS2

This is a discussion on Change codepage - OS2 ; Hi everyone, because I'm feeling lazy and tired, I'll ask instead of trying to figure out myself How can I change the codepage of a standard OS/2 control (specifically, the MLE)? the Presentation Parameters don't seem to cover this. For ...

+ Reply to Thread
Results 1 to 4 of 4

Thread: Change codepage

  1. Change codepage

    Hi everyone,
    because I'm feeling lazy and tired, I'll ask instead of trying to figure
    out myself

    How can I change the codepage of a standard OS/2 control (specifically,
    the MLE)?

    the Presentation Parameters don't seem to cover this. For MLE,
    MLM_SETFONT would presumably do it, but isn't there a generic way for
    native controls?

    Thanks

    Aaron
    --
    aaronl at consultant dot com
    For every expert, there is an equal and
    opposite expert. - Arthur C. Clarke

  2. Re: Change codepage

    In , on 12/09/2004
    at 03:49 AM, Aaron Lawrence said:

    >How can I change the codepage of a standard OS/2 control (specifically,
    >the MLE)?


    Good question. Best I can tell, the current PM codepage is consulted when
    the characters are rendered.

    >the Presentation Parameters don't seem to cover this. For MLE,
    >MLM_SETFONT would presumably do it, but isn't there a generic way for
    >native controls?


    WinSetPresParam() is the generic method. I'm not exactly sure why
    MLM_SETFONT exists. I haven't tested this, but I think MLM_SETFONT is
    used to change the font of existing text. If so, this would allow the
    existing content to be re-rendered in a different font without the app
    needing to reload the MLE content. This would mean it exists to improve
    performance.

    Steven


    --
    --------------------------------------------------------------------------------------------
    Steven Levine MR2/ICE 2.60b #10183
    Warp4/FP15/14.100c_W4 www.scoug.com irc.fyrelizard.com #scoug (Wed 7pm PST)
    --------------------------------------------------------------------------------------------


  3. Re: Change codepage

    On Wed, 8 Dec 2004 15:49:13 UTC, Aaron Lawrence wrote:

    > because I'm feeling lazy and tired, I'll ask instead of trying to figure
    > out myself
    >
    > How can I change the codepage of a standard OS/2 control (specifically,
    > the MLE)?
    >
    > the Presentation Parameters don't seem to cover this. For MLE,
    > MLM_SETFONT would presumably do it, but isn't there a generic way for
    > native controls?


    You can't change the codepage for "a control". You have to set it
    for a message queue - essentially, all PM operations on a given thread.
    This is quick, easy, and effective - until you decide to play with
    DBCS languages. Then you're screwed, at least wrt MLEs.

    For reasons unbeknownst to me, MLEs use the *process* codepage to
    determine the widths of DBCS glyphs (the process codepages are the
    ones set in config.sys & typically changed via CHCP). Further,
    this determination is only made when the MLE is created. This
    makes DBCS handling quite a pain: you have to set both process
    and PM codepages, then create the MLE (or destroy your existing
    MLE & recreate it).

    If you want to play with this stuff, get my CpPal from hobbes
    (cppal030.zip). It's GPL'd (uggh) so it has the source included.

    BTW... something I just learned today: if you're using Warp v4.5x
    with a UNI or SMP kernel, changing the LANG environment variable
    changes the PM codepage that apps use (but only for SBCS languages,
    AFAICT). For example, enter SET LANG=ru_RU at a cmd prompt, then
    run (a)e. CpPal will show that PM is using CP-866 while the
    process cp remains unchanged. Type Alt-148 and higher in the
    editor to get all those don't-know-what-you-call-em Cyrillic
    characters.


    --
    == == almost usable email address: rws AT e-vertise.com == ==
    __________________________________________________ _________________
    |
    | New - Remote Workplace Server v0.60
    Rich Walsh | interact with the WPS from any program
    Ft Myers, FL | http://e-vertise.com/rws/rws060.zip
    __________________________________________________ _________________

  4. Re: Change codepage

    Suddenly, Rich Walsh sprang forth and uttered these pithy words:
    > You can't change the codepage for "a control". You have to set it
    > for a message queue - essentially, all PM operations on a given thread.


    Well, OK, in general for native controls. However, the MLE has
    WM_QUERYFONT and WM_SETFONT. I'm now retrieving the FATTRS and changing
    codepage, and it seems to work - not that I have much to test with.

    > This is quick, easy, and effective - until you decide to play with
    > DBCS languages.


    Yah, well, small steps

    > For reasons unbeknownst to me, MLEs use the *process* codepage to
    > determine the widths of DBCS glyphs (the process codepages are the
    > ones set in config.sys & typically changed via CHCP). Further,
    > this determination is only made when the MLE is created. This
    > makes DBCS handling quite a pain: you have to set both process
    > and PM codepages, then create the MLE (or destroy your existing
    > MLE & recreate it).


    This doesn't really bother me, as I have to recreate the MLE frequently
    anyway; e.g. turning wrapping on and off.

    > If you want to play with this stuff, get my CpPal from hobbes
    > (cppal030.zip). It's GPL'd (uggh) so it has the source included.


    Yep, I downloaded that already for your list of codepages you mentioned
    a while back, and used that and Veit's list to create my own
    (categorised) entries...

    > BTW... something I just learned today: if you're using Warp v4.5x
    > with a UNI or SMP kernel, changing the LANG environment variable
    > changes the PM codepage that apps use (but only for SBCS languages,
    > AFAICT).


    Hm, so where does the CODEPAGE enter into it? Overrides the default from
    LANG?

    --
    aaronl at consultant dot com
    For every expert, there is an equal and
    opposite expert. - Arthur C. Clarke

+ Reply to Thread