1. A computer-implemented method for handling an email message received through a communication network, said email message including a target document, said target document involving an encoding scheme, the method comprising: training, using a plurality of text document samples that have been encoded with different encoding schemes and selected for training purposes to obtain a set of machine learning models, said different encoding schemes pertaining to charset encoding for transmission over a network, said training including using SIM (Similarity Algorithm) to generate said set of machine learning models from feature vectors converted from said plurality of text document samples, said feature vectors are grouped by charsets, wherein said training including generating fundamental units from said plurality of text document samples for charsets of said plurality of text document samples and extracting a subset of said fundamental units to form a set of feature lists, said feature vectors are converted from said set of feature lists and said plurality of text document samples, said extracting said subset of said fundamental units includes filtering said fundamental units to obtain fundamental units that are more discriminatory in describing differences among said different encoding schemes; applying said set of machine learning models against a set of target document feature vectors converted from said target document, said applying including analyzing said set of target document feature vectors using said set of machine learning models to compute similarity indicia between said set of target document feature vectors and said set of machine learning models associated with said different encoding schemes, said similarity indicia including at least a set of cross-angles between said set of target document feature vectors and said set of machine learning models, wherein a first encoding scheme associated with said set of machine learning models is designated as said encoding scheme if characteristics of said first encoding scheme as represented by said set of machine learning models are computed to be most similar, relative to other encoding schemes of said different encoding schemes, to said set of target document feature vectors; decoding said target document to obtain decoded content of said document based on at least said first encoding scheme; determining whether said email message is a spam message based on at least said decoded content of said document; and preventing said email message from reaching an email user if said email message is determined to be spam according to said determining.