Method for handling different code pages in text
First Claim
1. A method for handling text that uses a code page different than a native code page, comprising the steps of:
- (a) producing a piece table that includes an array of character positions, and an array of data records, said array of character positions being divided into a plurality of pieces, each data record corresponding to a piece of the array of character positions, each piece referencing adjacent characters of the text that have common format properties;
(b) based upon data in the array of data records, identifying files in which the text referenced by the plurality of pieces is stored;
(c) writing data blocks to each file, said data blocks recording a default code page for the text stored in each file;
(d) if any text stored in a file uses a code page different than the default code page recorded for said file, writing exception data to the data block that identify an exception code page for said text; and
(e) if the code page for any text to be displayed differs from the native code page, displaying said text by translating between the code page used by the text and the native code page, the code page for the text to be displayed remaining unchanged in the file in which said text is stored, so that any characters in the text that do not use the native code page are retained in said file.
1 Assignment
0 Petitions
Accused Products
Abstract
A method and word processing system for handling text pasted into a document that uses a foreign character set or code page. The code page used by text pasted into a document is preserved when that is displayed and edited. The word processing system keeps track of the appropriate code page for each run of text in the document using a piece table and a data block for the file(s) in which each piece of text is stored. Each document that is created has a piece table that includes an array of character positions and a corresponding array of data records. Each piece referenced in the array of character positions includes adjacent characters of text that are stored in a common file. When a file is opened to paste text into the document, the word processing system creates a file control block for that file, which includes a default code page identifier. The array of data records for each piece includes a pointer to the file control block. For any run of text that uses a code page different than the default for the file, an exception block is created. By referencing the default code page and any exception block, the word processing system determines the appropriate code page to be applied when text is displayed and edited. Foreign code page characters are translated into the native code page characters in the display buffer, but references to the foreign code pages are preserved when the document is stored, so that the characters encoded using the foreign code page are not lost or changed in the document.
55 Citations
29 Claims
-
1. A method for handling text that uses a code page different than a native code page, comprising the steps of:
-
(a) producing a piece table that includes an array of character positions, and an array of data records, said array of character positions being divided into a plurality of pieces, each data record corresponding to a piece of the array of character positions, each piece referencing adjacent characters of the text that have common format properties; (b) based upon data in the array of data records, identifying files in which the text referenced by the plurality of pieces is stored; (c) writing data blocks to each file, said data blocks recording a default code page for the text stored in each file; (d) if any text stored in a file uses a code page different than the default code page recorded for said file, writing exception data to the data block that identify an exception code page for said text; and (e) if the code page for any text to be displayed differs from the native code page, displaying said text by translating between the code page used by the text and the native code page, the code page for the text to be displayed remaining unchanged in the file in which said text is stored, so that any characters in the text that do not use the native code page are retained in said file. - View Dependent Claims (2, 3, 4, 5, 6, 7)
-
-
8. A method for handling text using a code page that is different than a native code page used in a document into which the text is pasted, comprising the steps of:
-
(a) producing a piece table by scanning characters comprising the document to develop an array of character positions and an array of data records, said characters in the document being referenced in the array of character positions by a sequence of character position coordinates, said array of character positions being divided into a plurality of pieces, each piece comprising characters of text that are disposed adjacent to each other in the document and which have common properties; (b) including in each record of the array of data records; (i) a file number for a corresponding piece of the array of character positions, said file number indicating a file in which the characters referenced in the piece are stored; and (ii) a file position in said file where said characters are to be found; (c) producing a file control block for any file that is opened to paste text into the document, said file control block including code page identifier data indicating a default code page for the text stored in said file, and thus, for the text referenced by any of the pieces; (d) providing a data block for each file that is opened to paste text into the document, said data block including a specifier for an exception code page to be used for any run of text in the file that has a different code page than the default code page for the file in which the run of text is stored, so that the default code page for the file in which the run of text is stored and the data block for the run of text are checked to determine the code page to be applied to all of the characters in said run of text; and (e) when the code page used by any run of text to be displayed is different than the native code page, translating the code page for the characters in the run of text to be displayed to the native code page using a closest available mapping, said code page for the run of text being retained if the document is saved to a file, thereby ensuring that a reference to the code page for any text pasted into the document is not omitted from the file to which the document is saved. - View Dependent Claims (9, 10, 11, 12, 13, 14, 15)
-
-
16. A method employed in a word processing system for handling text pasted into a document, the pasted text using a foreign code page, which is different than a native code page of the word processing system, comprising the steps of:
-
(a) as the document is created, producing an array of character positions that reference each character of the document with a position coordinate, said array of character positions comprising a plurality of pieces, each piece including a sequence of characters adjacent to each other in the document, which all have a common format; (b) producing an array of data records, each record corresponding to one of the pieces comprising the array of character positions and including a pointer to a file in which the characters referenced by the position coordinates of said piece are stored; (c) for each file that stores text used in the document, recording data indicating the code page used for the text stored in the file; and (d) when any character of the document is displayed, determining the code page used by said character by reference to the array of character positions, the array of data records, and the file control block for the file in which the character is stored, and if the character uses a foreign code page, translating between the code page used by the character and the native code page to display a best available mapping of the character, any references to the foreign code page for characters of the text in the document being retained when the document is saved to a file so that characters that cannot be accurately mapped from the foreign code page to the native code page are not lost. - View Dependent Claims (17, 18, 19, 20)
-
-
21. A word processing system for handling text pasted into a document, the pasted text using a foreign code page that is different than a native code page of the word processing system, comprising:
-
(a) a computer that executes predefined instructions for processing text, said computer including a memory in which the predefined instructions are loaded, a display screen, and a user interface that enables a user to enter text to produce a document; (b) a non-volatile memory in which data developed on the computer using the word processing system are stored in files; (c) means for producing in the memory of the computer an array of character positions that reference each character of the document with a position coordinate, said array of character positions comprising a plurality of pieces, each piece including a sequence of characters disposed adjacent to each other in the document and having a common format; (d) means for producing an array of data records, each data record corresponding to one of the pieces comprising the array of character positions and including a pointer to a file in which the characters referenced by the position coordinates of said piece are stored in the non-volatile memory; (e) for each file in which text used in the document is stored, means for recording data indicating the code page used for the text stored in the file; and (f) means for determining the code page used by any character of the document that is displayed by reference to the array of character positions, the array of data records, and the file control block for the file in which the character is stored, and if the character uses a foreign code page, means for translating between the foreign code page used by the character and the native code page to display a best available mapping of the character, any references to the foreign code page for characters of the text in the document being retained when the document is saved to a file so that characters that cannot be accurately mapped from the foreign code page to the native code page are not lost. - View Dependent Claims (22, 23, 24, 25)
-
-
26. A method for exchanging documents between word processing systems that use different code pages for encoding text, without any loss or change of characters in the documents as a result of differences in said code pages, comprising the steps of:
-
(a) enabling a user to open a file on a first word processing system that uses a first code page to encode text, said document having been created by a second word processing system and containing text encoded by a second code page that is not native to the first word processing system; (b) displaying at least a portion of the text from the document on the first word processing system, by translating between the second code page and the first code page to display characters from the first code page using a best possible match to characters of the second code page contained within said text that is displayed; and (c) enabling the user to save the document to a second file with the first word processing system and to retain the second code page encoding of the text in the document saved in the second file, so that all characters encoded with the second code page that are stored in the second file are displayed when the second file is opened for display on the second word processing system.
-
-
27. A method usable in a word processing system for handling text stored in a first file that is encoded using a foreign code page, which is different than a native code page, so that any character in the text for which there is no native code page encoded equivalent character is not lost or changed when said first file is opened by the word processing system for display in a document and then said document is saved to a second file, comprising the steps of:
-
(a) opening said first file containing the text encoded in the foreign code page for entry of at least a portion of the text into the document; (b) determining if a default code page of the text selected to be displayed is identical to the native code page; (c) identifying any exceptions records for characters in the text selected for display; (d) where native code page encoded characters exist that correspond to characters of the text encoded with the foreign code page, translating said characters encoded with the foreign code page to corresponding native code page encoded characters and temporarily storing the native code page characters in a display buffer, and if no corresponding native code page characters exist, temporarily storing native code page characters that comprise a best possible match in the display buffer; (e) displaying the native code page characters temporarily stored in the display buffer on a display screen; and (f) storing the document in said second file so that the text in the document that was encoded using the foreign code page is still encoded using the foreign code page and so that in said second file, no characters encoded in the foreign code page are changed or lost as a result of being stored in the second file, when the document is thus saved. - View Dependent Claims (28, 29)
-
Specification