How to use the UTF-16/UTF-32 Type Manager feature in Rational ClearCase

Technote (FAQ)


Question

How do you use the UTF-16/UTF-32 Type Manager feature for automatically detecting the UTF-16 and UTF-32 file types in IBM Rational ClearCase?

Answer

The steps in the following examples can be used to handle UTF-16 and UTF-32 files in Rational ClearCase 7.1. For UTF-8. Review technote 1424805: Enable UTF-8 Type Manager for more details.

  1. Run the following commands to add new element types for UTF-16 and UTF-32.

    cleartool mkeltype -nc -supertype file -manager utf16be_file_delta utf16be_file
    cleartool mkeltype -nc -supertype file -manager utf16le_file_delta utf16le_file
    cleartool mkeltype -nc -supertype file -manager utf32be_file_delta utf32be_file
    cleartool mkeltype -nc -supertype file -manager utf32le_file_delta utf32le_file


  2. Add a new magic file _utf16.magic under the ccase-home-dir\config\magic directory to automatically detect the utf16xx_file type for files containing a BOM.

    # Match files containing a BOM for UTF-16 (BE)
    utf16be_file compressed_file : (-magic 0, byte, 0xFE) & (-magic 1, byte, 0xFF);
    # Match files containing a BOM for UTF-16 (LE)
    utf16le_file compressed_file : (-magic 0, byte, 0xFF) & (-magic 1, byte, 0xFE);
    # Match files containing a BOM for UTF-32 (BE)
    utf32be_file compressed_file : (-magic 0, byte, 0x00) & (-magic 1, byte, 0x00) & (-magic 2, byte, 0xFE) & (-magic 3, byte, 0xFF);
    # Match files containing a BOM for UTF-32 (LE)
    utf32le_file compressed_file : (-magic 0, byte, 0xFF) & (-magic 1, byte, 0xFE) & (-magic 2, byte, 0x00) & (-magic 3, byte, 0x00);

Related information

Enable UTF-8 Type Manager
Information Center Help - Type Manager
Working with Rational ClearCase Unicode Type Manager
Wikipedia - Byte_order_mark

Rate this page:

(0 users)Average rating

Add comments

Document information


More support for:

Rational ClearCase
Magic File

Software version:

7.1, 7.1.1, 7.1.2

Operating system(s):

Windows

Reference #:

1587676

Modified date:

2013-05-08

Translate my page

Machine Translation

Content navigation