Fixed building triples functions. Added a function to encode some characters to Utils