In 1997 we proved that any triangular semisimple Hopf algebra over an algebraically closed field k of characteristic 0 is obtained from the group algebra k[G] of a finite group G, by twisting its comultiplication by a twist in the sense of Drinfeld. In this paper, we generalize this result to not necessarily finite-dimensional cotriangular Hopf algebras. Namely, our main result says that a cotriangular Hopf algebra A over k is obtained from a function algebra of a pro-algebraic group by twisting by a Hopf 2-cocycle, and possibly changing its R-form by a central grouplike element of A^* of order <=2, IF AND ONLY IF the trace of squared antipode on any finite-dimensional subcoalgebra of A is the dimension of this subcoalgebra. This generalization, like the original theorem, is proved using Deligne's theorem on Tannakian categories. In the second half of the paper, we give examples of twisted function algebras. In particular, we show that in the infinite- dimensional case, the squared antipode may not equal the identity. On the other hand, we show that in all of our examples of twisted function algebras, the squared antipode is unipotent, and conjecture it to be the case for any twisted function algebra. We prove this conjecture in a large number of special cases, using the quantization theory of the first author and D.Kazhdan.