Menu

Garbage in Input fields using / (slash) and accents '

2021-07-24
2021-08-06
  • Erich Mueller

    Erich Mueller - 2021-07-24

    edit phenomen in Input Text Fields
    using:
    cobc (GnuCOBOL) 3.1.2.0
    Erstellt Apr 30 2021 14:56:57 Gepackt Dec 23 2020 12:04:58 UTC
    C-Version "10.2.1 20210110"
    Standard-Konfigurationsdatei »default.conf« wird geladen
    cobc: Fehler: Keine Eingabedateien

    Inputfield in screen section type USING has some content

    This is the content

    If I change the field:

    This is the content /or not

    I get something like that

    /or notThis is the content

    playing around getting similar effects with accents
    trying harder the field content appears in other fields of the same screen.

    older programs, which I will not compile now behave o.k.

    Thanks for any ideas Erich

     
    • Simon Sobisch

      Simon Sobisch - 2021-07-25

      Can you please provide a minimal reproducer (COBOL example for your notes)?
      BTW: You likely wanted to provide cobc -V, which is the long form ofcobc --version, not cobc -v, which is the long form of cobc --verbose.
      ... and actually, in this case cobcrun --verbose --info (likely cobcrun -vi as short form) would be useful in this special case.

       
  • Erich Mueller

    Erich Mueller - 2021-07-26

    Hello I am still fighting the textfield garbage problem my be I even killed Eugenio's COBOL environment with my testprogram - sorry Eugenio.
    Here is my cobinfo DEBIAN 11 with today updates
    the program and some pictures
    libcob (GnuCOBOL) 3.1.2.0
    Copyright (C) 2020 Free Software Foundation, Inc.
    License LGPLv3+: GNU LGPL version 3 or later http://gnu.org/licenses/lgpl.html
    Dies ist freie Software; die Kopierbedingungen stehen in den Quellen. Es gibt
    KEINE Garantie; auch nicht für MARKTGÄNGIGKEIT oder FÜR SPEZIELLE ZWECKE.
    Geschrieben von Keisuke Nishida, Roger While, Ron Norman, Simon Sobisch, Edward Hart
    Erstellt Apr 30 2021 14:56:38
    Gepackt Dec 23 2020 12:04:58 UTC

    Build-Informationen
    Build-Umgebung : x86_64-pc-linux-gnu
    CC : gcc
    C-Version : "10.2.1 20210110"
    CPPFLAGS :
    CFLAGS : -O2 -pipe -finline-functions -fsigned-char -Wall
    -Wwrite-strings -Wmissing-prototypes
    -Wno-format-y2k
    LD : /usr/bin/ld -m elf_x86_64
    LDFLAGS : -Wl,-z,relro,-z,now,-O1

    GnuCOBOL-Information
    COB_MODULE_EXT : so
    dynamic loading : system
    "CBL_" param check : Deaktiviert
    64bit-mode : ja
    BINARY-C-LONG : 8 Bytes
    Bytereihenfolge : Little-Endian
    Natives EBCDIC : nein
    Dateiformat für Variabl : 0
    Verarbeitung sequenziell : eingebaut
    indexed file handler : BDB, version 5.3.28
    Mathematische Bibliothek : GMP, version 6.2.1
    XML-Bibliothek : Deaktiviert
    JSON-Bibliothek : Deaktiviert
    Erweiterte Bildschirm-Ei : ncursesw, version 6.2.20201114 (CHTYPE=32, WIDE=1)
    xterm with 256 colors
    mouse support : ja

     
  • Simon Sobisch

    Simon Sobisch - 2021-07-28

    I've rechecked that with 3.1.2 and ncursesw and did not found any left adjustments:

    • compile with -xg -free
    • run
    • pressed ENTER
    • entered some data with leading spaces
    • pressed ENTER
    • seen the text not be left adjusted

    Note: you've posted the output of cobc --info (build and compiler), cobcrun -v --info will show the runtime part which may be different "somewhere", but I guess cobcrun --runtime-config will show more differences. Mine (reduced to the relevant entries) shows:

     Screen I/O configuration
        : COB_BELL               : not set
        : COB_REDIRECT_DISPLAY   : no       (default)
        : COB_SCREEN_ESC         : no       (default)
        : COB_SCREEN_EXCEPTIONS  : no       (default)
        : COB_TIMEOUT_SCALE      : not set  (1000)
        : COB_INSERT_MODE        : no       (default)
        : COB_MOUSE_FLAGS        : 1        (default)
     System configuration
     env: USERNAME               : 'simon'  (set by LOGNAME)
     env: LANG                   : 'C.UTF-8'
        : OSTYPE                 : not set
     env: TERM                   : 'xterm-256color'
        : LC_CTYPE               : C
    

    and the relevant parts of cobcrun -vi:

    extended screen I/O      : ncurses, version 6.2.20210109 (CHTYPE=32, WIDE=1)
                               xterm with 256 colors
    mouse support            : yes
    

    What about yours?

    In general: can you please explicit state the issues you have? I'm not sure yet (other than the auto-trim left which I can't reproduce).

    Note for the test program: let the directive in line 1 start in the column 8 which will lead to the compiler recognize it:

           >>SOURCE FORMAT IS FREE
    

    instead of recognizing garbage:

    >>SOURCE FORMAT IS FREE
    
     
  • Erich Mueller

    Erich Mueller - 2021-07-28

    Thank you for your patience

    Konfiguration der Bildschirm-Ein-/Ausgabe
    : COB_BELL : not set
    : COB_REDIRECT_DISPLAY : nein (Standard)
    : COB_SCREEN_ESC : nein (Standard)
    : COB_SCREEN_EXCEPTIONS : nein (Standard)
    : COB_TIMEOUT_SCALE : not set (1000)
    : COB_INSERT_MODE : nein (Standard)
    : COB_MOUSE_FLAGS : 1 (Standard)
    : COB_MOUSE_INTERVAL : 100 (Standard)
    : COB_DISPLAY_PRINT_PIPE : not set
    : COB_DISPLAY_PRINT_FILE : not set
    : COB_DISPLAY_PUNCH_FILE : not set
    : COB_LEGACY : nein (Standard)
    : COB_EXIT_WAIT : ja (Standard)
    : COB_EXIT_MSG : 'end of program, please press a key to exit' (Standard)

    I think the ... DISPLAY_PRINT... are not important
        Thank you for the source FREE lesson
    
        compiling with -xg  C-debug sorry dont know how to do
    
        In meantime came a bit closer to the problem:
    
        Left adjusting process: if you add more text into a field
        but you do not type blanks but go there with the mouse so
        it puts everything right from the mouse-position to the field-beginning  overwriting what is there.
    
        SET ENVIRONMENT 'COB_COL_JUST_LRC'  TO "OFF"  cant see any effect
    
    
    I could get closer to the situation which I have to describe verbally
    
    I have a PIC X(30) screen field
    The program fills the first 15 bytes  123456789012345
    I want to enter more text
    I go with mouse or cursor to position 20  and type XXXXX
    enter I get 
    XXXXX6789012345
    
    Going with cursor to position 16 and type 4 Blanks and XXXXX
    I get what I want: 123456789012345    XXXXX
    
    This explains part of my trouble there is more:
    pressing the insert key  and type ä ö ü etc
    I see a space and not the letter I typed. (not so important)
    
    
    Tying to delete blank between two words I have to
    press the delete button twice. (Not always)
    Like when I want to delete ö ä etc. (where it is common)
    so sometimes a blank is not always a blank but some 2-byte
    character like the umlaute but not visible
    

    one more:
    Type
    gruen enter
    gruen 3 -blanks XXXXX enter
    makes gruen XXXXX what I expect
    but
    grün enter
    grün 3blanks XXXXX enter
    makes grü XXXXXX

    A hex screen dump would show more but I have no idea how to make visible what
    is behind the screen

    My Umlaut configuration always worked ! ?
    

    SOURCE-COMPUTER. gnulinux.
    OBJECT-COMPUTER. gnulinux
    CHARACTER CLASSIFICATION IS deutsch.

    SPECIAL-NAMES.
    CRT STATUS is statuscrt
    CURSOR IS CSRRCC
    DECIMAL-POINT IS COMMA
    LOCALE deutsch is "de_DE.UTF-8".

    For me it looks like
    that blanks ,cursor movement, mouse-positioning produce a different behaviour.
    Umlaute produce some kind of line break "within" the field

    The left adjustment and umlaut look for me to be different construction sites
    Doing my tests I had texts with and without ä ö ß etc . so I could not find a red line

    So hopefully you have an idea Thanks Erich

     
    • Brian Tiffin

      Brian Tiffin - 2021-07-29

      This might be an issue of 2+ byte unicode code points. That can make single byte PIC X computations hard to figure out sometimes, depending on where control breaks in code happen...where ever that may be in the operating mix. Then it might depend on a fluke of byte codes taken as out of band terminal control codes. There will be an explanation somewhere though.

      Cheers,
      Blue

       
    • Ralph Linkletter

      When the mouse button is the cause of an interrupt are you able to discern the row and column of the mouse input?
      In my WINANIM application I know the row column coordinates when a mouse button is pressed. I compare those coordinates to the terminal cursor row column coordinates. If the mouse was the event I then call a routine to position the terminal cursor to the row column of the mouse press.
      Keying data is then synchronized with the mouse and terminal interacting at the same buffer position.

      I do the above at an WinAPI level - I don't know if curses permits such low level interfacing.
      Ralph

       
  • Erich Mueller

    Erich Mueller - 2021-08-06

    So what is my option ?
    Live with it , or wait for next release ? or .... ???
    so long Erich

     
    • Simon Sobisch

      Simon Sobisch - 2021-08-06

      As PIC X and UTF-8 don't work well together I'd suggest to swap to ISO8859-15 for now; we should investigate UTF-8 and ncursesw, but I'm not available for that myself in the weeks.

       

Anonymous
Anonymous

Add attachments
Cancel