In this paper we propose a new method for improving the clustering accuracy of text data. Our method encodes the string values of a dataset using Arithmetic encoding algorithm, and declares these attributes as integer in the clustering phase. In the experimental part, we calculate the efficiency of proposed method, and we obtained a better clustering accuracy than the one found with traditional methods. This method is useful when the dataset to be clustered has only string attributes, because in this case, a traditional clustering method does not recognize, or recognize with a low accuracy, the category of instances.