Browse Prior Art Database

Optimized Character Conversion for Unlike Code Pages

IP.com Disclosure Number: IPCOM000109527D
Original Publication Date: 1992-Sep-01
Included in the Prior Art Database: 2005-Mar-24
Document File: 2 page(s) / 76K

Publishing Venue

IBM

Related People

Amundsen, L: AUTHOR [+3]

Abstract

Converting characters from one code page to another involves mapping a character from one code page into an equivalent character in a second code page. The usual conversion method involves replacing a character with an equivalent character stored in memory or in a file on disk.

This text was extracted from an ASCII text file.
This is the abbreviated version, containing approximately 60% of the total text.

Optimized Character Conversion for Unlike Code Pages

       Converting characters from one code page to another
involves mapping a character from one code page into an equivalent
character in a second code page.  The usual conversion method
involves replacing a character with an equivalent character stored in
memory or in a file on disk.

      This article describes an algorithm that implements an
optimized approach to converting characters between different code
pages, resulting in faster execution and reduced memory requirements.
DESCRIPTION OF THE ALGORITHM

      Many supported code pages have characters that are invariant
for code point positions less than decimal 128.  The following is an
optimized algorithm for converting characters between unlike code
pages, if the code pages meet this invariant criteria.

      The following algorithm uses a procedure that accepts a
character string and converts the string:
DECLARE SIGNED CHARACTER VARIABLE, CH FOR EACH CHARACTER IN THE INPUT
STRING {
      ASSIGN THE CHARACTER TO CH
      IF CH > 0 {
           THE CHARACTER DOES NOT NEED CONVERSION.  CH > 0 IMPLIES
THAT THE CHARACTER IS BETWEEN 0 AND 127, THE INVARIANT SET, BECAUSE
IF CH IS ASSIGNED A CHARACTER GREATER THAN 127, A NEGATIVE VALUE
WOULD APPEAR IN CH SINCE A SIGNED CHARACTER CANNOT CONTAIN A VALUE
GREATER THAN 127.
      }
      else {
           STRIP THE HIGH ORDER BIT FROM THE INPUT CHARACTER, AND USE
T...