An encoding program comprising instructions which when the program is executed by a computer, causes the computer (100, 200) to carry out: identifying a plurality of tag sections and a plurality of original text sections in input character data that includes a tag having a variable section; first converting each of a plurality of tags included in the plurality of tag sections into a respective first-type code that corresponds to collective tag content of the respective tag, the first converting including registering the plurality of tags in a tag buffer included in a dynamic dictionary, assigning the first-type code in the order it is registered and storing the first-type code, a tag type and a storage location in a related manner in an address table included in the dynamic dictionary, wherein the first-type code has a predetermined fixed-length and the storage location is that of the corresponding tag in the tag buffer; second converting original texts in the plurality of original text sections into a plurality of second-type codes based on a static dictionary, each of the plurality of second-type codes being separated at least in boundaries between the plurality of tag sections and the plurality of original text sections in the input character data; outputting an encoded data including the plurality of first-type codes converted from the tag sections in the input character data at the first converting, the plurality of second-type codes converted from the original text sections in the input character data at the second converting and the dynamic dictionary, wherein positional relationships of the plurality of tags and the original texts in the input character data being maintained with corresponding plurality of first-type codes and corresponding plurality of second-type codes in the encoded data; and searching whether a search keyword surrounded by tags is present in the encoded data output by the outputting by receiving the search keyword and a tag type of the search tag; reading the encoded data output by the outputting; using the tag type to identify a given first-type code corresponding to the tag type of the search tag; identifying a given second-type code that corresponds to the search keyword from the static dictionary; searching an appearance position of the given first-type code and the appearance position of the given second-type code with regard to the encoded data; determining whether the appearance position matches a search condition, wherein the search condition is such that the appearance position of the given first-type code surrounds the appearance position of the given second-type code; outputting a character string that is obtained by decompressing the compressed portion at the appearance position that matches the search condition on the basis of the dynamic dictionary. identifying a plurality of tag sections and a plurality of original text sections in input character data that includes a tag having a variable section; first converting each of a plurality of tags included in the plurality of tag sections into a respective first-type code that corresponds to collective tag content of the respective tag, the first converting including registering the plurality of tags in a tag buffer included in a dynamic dictionary, assigning the first-type code in the order it is registered and storing the first-type code, a tag type and a storage location in a related manner in an address table included in the dynamic dictionary, wherein the first-type code has a predetermined fixed-length and the storage location is that of the corresponding tag in the tag buffer; second converting original texts in the plurality of original text sections into a plurality of second-type codes based on a static dictionary, each of the plurality of second-type codes being separated at least in boundaries between the plurality of tag sections and the plurality of original text sections in the input character data; outputting an encoded data including the plurality of first-type codes converted from the tag sections in the input character data at the first converting, the plurality of second-type codes converted from the original text sections in the input character data at the second converting and the dynamic dictionary, wherein positional relationships of the plurality of tags and the original texts in the input character data being maintained with corresponding plurality of first-type codes and corresponding plurality of second-type codes in the encoded data; and searching whether a search keyword surrounded by tags is present in the encoded data output by the outputting by receiving the search keyword and a tag type of the search tag; reading the encoded data output by the outputting; using the tag type to identify a given first-type code corresponding to the tag type of the search tag; identifying a given second-type code that corresponds to the search keyword from the static dictionary; searching an appearance position of the given first-type code and the appearance position of the given second-type code with regard to the encoded data; determining whether the appearance position matches a search condition, wherein the search condition is such that the appearance position of the given first-type code surrounds the appearance position of the given second-type code; outputting a character string that is obtained by decompressing the compressed portion at the appearance position that matches the search condition on the basis of the dynamic dictionary.