EGL Development User Group

  • 1.  Portuguese Characters

    Posted Mon August 24, 2015 03:29 PM

    Hi Folks,

    I'm generating a EGL WEB Transaction program and it has a Portuguese characters (Á á Ó ó Ç ç ...).

    First Case:

    There is in the UIRecord variable and value:

         5 CD_FUN int // Codigo Funcionario
            { uiType = inputOutput, sign = none,
              displayName = "Codigo Funcionario"
            } ; 

     

    and the Java source generated:

            com.ibm.javart.webtrans.format.EGLNumericItemFormat newEds = new com.ibm.javart.webtrans.format.EGLNumericItemFormat( WEBT01A_UIR.CD_FUN );
            newEds.setBean( this );
            newEds.initializeInputs( 1 );
            newEds.setLabel( "Codigo Funcionario" );

    but show correctly in web browser:

    Código Funcionário

     

    Second Case:

    There is in the DataTable with data values:

        [0001, "Informatica                   "],
        [0004, "Logistica                     "],

    and the Java source genereted:

            this.NM_005fDPT.getElement( ezeProgram, 1 ).setValue( "Informatica                   " );
            this.NM_005fDPT.getElement( ezeProgram, 4 ).setValue( "Logistica                     " );

    but show wrong in web browser:

    <OPTION VALUE="2">Informatica
    <OPTION VALUE="5">Log?stica

     

    I did not found any build option to preserve the special characters when generate to java and running on windows.

    How to do it ?  Are there some generation option or preferences or project properties to set options ?

    Ie. there is no problem In VisualAge Web Transaction running in ITF .

    Thanks !!

    Hsieh

     

     

     

    Hsieh


  • 2.  Re: Portuguese Characters

    Posted Mon August 24, 2015 04:50 PM

    Hi,

    It looks like the generated java is recognizing the characters and preserving them in the java itself as you can see the special characters are the utf equivalent in both cases.

    So somewhere between the generated datatable and the what is used to populate the browser it is getting changed or maybe the way it is populated is different.

    To pursue, I think I would suggest looking at the following:

    a.) What type of datatable is this?   Is a "message" table?

    b.) How is the value set for the page?

    c.) What does the code in the JSP look like for the one that fails? 

    d.) You could set tracing on in the gw.properties and the csogw.properties.  This will show the "buffers" for the UI record so might provide some information.

    Mark

    markevans


  • 3.  Re: Portuguese Characters

    Posted Mon August 24, 2015 05:18 PM

    Hi Mark,

    Ok ! I understood.

    responses following:

     

    a.) What type of datatable is this?   Is a "message" table?

    It's matchValidTable

    b.) How is the value set for the page?

    html source code:

    <OPTION VALUE="2">Informßtica
    <OPTION VALUE="5">Log?stica

    c.) What does the code in the JSP look like for the one that fails? 

    <SELECT NAME="CMB_CRG_IND" SIZE="1">
        <% { %>
            <% 
                java.util.Enumeration ezeItems = CMB_NM_CRG.occurrences();
                while (ezeItems.hasMoreElements()) {
                    VGDataElement ezeItem = (VGDataElement)ezeItems.nextElement(); %>
                    <% if (ezeItem.isSelected()) { %>
                        <OPTION VALUE="<%= ezeItem.getIndex() + 1 %>" SELECTED><%= ezeItem.getTextValue() %>
                    <% } else { %>
                        <OPTION VALUE="<%= ezeItem.getIndex() + 1 %>"><%= ezeItem.getTextValue() %>
                    <% } %>
                <% } %>
        <% } %>
        </SELECT>

     

    d.) You could set tracing on in the gw.properties and the csogw.properties.  This will show the "buffers" for the UI record so might provide some information.

    Ok ! I will do it.

    Hsieh


  • 4.  Re: Portuguese Characters

    Posted Mon August 24, 2015 05:22 PM

    Hsieh,

     

    When I asked how the value was set for the Options, I meant how was it set in the EGL code.   A table assigned to a field, move statements from the datatable to the UI record, etc?

     

    thanks.

    markevans


  • 5.  Re: Portuguese Characters

    Posted Mon August 24, 2015 06:03 PM

    Oh ! so sorry.

    DataTable TBCARGO type matchValidTable  {
      shared = yes, resident = no
      }
      3 CD_CRG num(4); // Código Cargo
      3 NM_CRG char(30); // Nome Cargo
       {contents = [
        [0001, "Programador                   "],
        [0002, "Analista Sistema              "],
        [0003, "Analista Produção             "],
        [0004, "Analista Banco de Dados       "],
        [0005, "Auxiliar Administrativo       "],
        [0006, "Office Boy                    "],
        [0007, "Auxiliar de Compras           "],
        [0008, "Secretária                    "],
        [0009, "Operador                      "],
        [0010, "Auxiliar Geral                "],
        [0011, "Segurança                     "]
      ]}
    end // end TBCARGO

     

     move TBCARGO.NM_CRG to WEBT01A_UIR.CMB_NM_CRG[2] for all;

     

    Hsieh


  • 6.  Re: Portuguese Characters

    Posted Mon August 24, 2015 06:14 PM

    Hsieh,

     

    thanks.  To be picky, your "second case" in the first post was referring to values in a table that are not the ones you pasted in the last post.   Could that be part of the problem?  

     

    I don't see anything obvious.

     

    Could you possibly attach a small sample of a web transaction program with the issue and/or open a PMR?

     

    And if you can get the trace, it might show something.

     

    thanks

    Mark

    markevans


  • 7.  Re: Portuguese Characters

    Posted Mon August 24, 2015 07:58 PM

    Hi Mark,

    I sent for your inbox. 

    Please, let me know if you received or not.

     

    Thanks !

     

    Hsieh


  • 8.  Re: Portuguese Characters

    Posted Wed August 26, 2015 03:32 PM

    Hsieh

    Tried to send you an email back, but it was rejected. 

    In looking at the output.log/trace

     

    I think the problem may be the specification of the CONTABLE=CSOX437 in the csogw.properties.   Can you try this with the windows code page for Brazilian Portuguese?  437 is US english.   Also with Direct, you don't need localhost and port as it is a direct Java call.   Maybe you could try CSOX850 (if running on Unix/AIX or equivalent to what you are using now but with the Brazilian name)  or CSOI1252 if running on Windows.  I think the CSOX850 would be my first try.

    If this does not resolve it,

    I can try if you are running on Windows, but need to know

    - what regional setting/locale you are running on?

    - If you go to a command prompt and type in chcp,  what is the result?

    - And what application server are you using (WAS V?? Or Tomcat V??).

    By the way, the labels are not passed between the UI program and the JSP like the table contents are...so think that is the difference (or I did not see them in the output.log and its in/out buffers) as the labels do not have to be converted by the GatewayServlet but the data that came out of the table does.

     

    Thanks.

    markevans


  • 9.  Re: Portuguese Characters

    Posted Wed August 26, 2015 05:20 PM

    Hei,

    You always know where the problems !!
    I had not thought of that! There are many parameters in several places.

    One more tips for my note books.

    The parameter is:

    serverLinkage.localApp.contable=CSOJ1252

    contable
    Specifies the conversion table used on the tier 2 platform. The format is as follows:
    CSOzxxxx;
    z
    One of the following binary formats, which refers to the tier 3 platform:
    • I (for Intel®)
    • E (for EBCDIC)
    • J (for Java Unicode)
    • X (for UNIX®)
    xxxx
    The code page used for conversion.

    Thanks a lot !

    Hsieh

    Hsieh


  • 10.  Re: Portuguese Characters

    Posted Wed August 26, 2015 05:37 PM

    I hope this means it worked after you made the change????

     

    markevans


  • 11.  Re: Portuguese Characters

    Posted Wed August 26, 2015 05:52 PM

    Oh Yes !!!  Mark.

    with contable=CSOJ1252  (Java Unicode)

    I have tried with CSOI1252, CSOI037,CSOI850 and does not work.

    Hsieh