[NEWSboard IBMi Forum]

Hybrid View

  1. #1
    Registriert seit
    May 2002
    Beiträge
    2.643
    http://publib.boulder.ibm.com/infoce...o/apis/icu.htm

    International Components for Unicode (ICU)
    The International Components for Unicode (ICU), option 39, is a C and C++ library that provides Unicode services for writing global applications in ILE programming languages. ICU offers flexibility to extend and customize the supplied services, which include:

    Text: Unicode text handling, full character properties and character set conversions (500+ codepages)
    Analysis: Unicode regular expressions; full Unicode sets; character, word and line boundaries
    Comparison: Language sensitive collation and searching
    Transformations: normalization, upper/lowercase, script transliterations (50+ pairs)
    Locales: Comprehensive locale data (230+) and resource bundle architecture
    Complex Text Layout: Arabic, Hebrew, Indic and Thai
    Time: Multi-calendar and time zone
    Formatting and Parsing: dates, times, numbers, currencies, messages, and rule-based
    ICU is an open source development project sponsored, supported, and used by IBM(R). ICU provides over 200 APIs that you can use to process Unicode data in your ILE application. See the RPG example and COBOL example for example code that calls an ICU API.

    Additional information about ICU can be found at International Components for Unicode.



    Example of RPG program calling an ICU API
    See Code disclaimer information for information pertaining to code examples.

    This ILE RPG program example calls the u_isdigit ICU API to check whether the Unicode character is a digit.

    H DftActGrp(*NO) BndDir('QICU/QXICUAPIBD')
    DIsDigit pr 10i 0 extproc('u_isdigit')
    D 10u 0 value
    DMapping ds
    D ch 10u 0 inz(0)
    D UCSChar 3 4c
    DRtnCode s 10i 0
    DTrue c 1
    C eval UCSChar = %UCS2('A')
    C eval RtnCode = IsDigit(ch)
    C exsr Check
    C eval UCSChar = %UCS2('1')
    C eval RtnCode = IsDigit(ch)
    C exsr Check
    C eval *inlr = '1'
    C return
    C Check begsr
    C UCSChar dsply
    C if RtnCode = True
    C 'Is digit' dsply
    C else
    C 'Not digit' dsply
    C endif
    C endsr




    Example of COBOL program calling an ICU API
    See Code disclaimer information for information pertaining to code examples.

    This ILE COBOL program example calls the u_isdigit ICU API to check whether the Unicode character is a digit.

    PROCESS NOMONOPRC NATIONAL.
    IDENTIFICATION DIVISION.
    PROGRAM-ID. ISDIGIT.
    DATA DIVISION.
    WORKING-STORAGE SECTION.
    01 char.
    05 filler PIC S9(04) BINARY VALUE 0.
    05 UCSChar PIC N(01).
    01 Rtn PIC S9(09) BINARY.
    PROCEDURE DIVISION.
    MAIN-LINE.
    MOVE "A" to UCSChar.
    CALL LINKAGE PRC "u_isdigit" USING BY VALUE char GIVING Rtn.
    PERFORM CHECK.
    MOVE "1" to UCSChar.
    CALL LINKAGE PRC "u_isdigit" USING BY VALUE char GIVING Rtn.
    PERFORM CHECK.
    STOP RUN.
    CHECK.
    DISPLAY UCSChar.
    IF Rtn = 1
    DISPLAY "Is digit"
    ELSE
    DISPLAY "Not digit"

  2. #2
    Registriert seit
    Oct 2001
    Beiträge
    84
    Ah.....ja.

    Danke Tarasik.

    Wenn ich das richtig verstehe, sind das Erweiterungen, die die Entwicklung von landes- und sprachenspezifischer Software unterstützen.

    Damit dürfte also Software, welche bereits vor dem Upgrade auf V5R2 installiert war, ohne diese Option auskommen.

    Danke.

    Mirko

Berechtigungen

  • Neue Themen erstellen: Nein
  • Themen beantworten: Nein
  • You may not post attachments
  • You may not edit your posts
  •