fixed encoding problem and confidence double/float conversion