  This paper is a detailled study of the coding of real trees by real valued
functions that is motivated by probabilistic problems related to continuum
random trees. Indeed it is known since the works of Aldous (1993) and Le Gall
(1991) that a continuous non-negative function $h$ on $[0,1]$ such that
$h(0)=0$ can be seen as the contour process of a compact real tree. This
particular coding of a compact real tree provides additional structures, namely
a root that is the vertex corresponding to $0\in [0,1]$, a linear order
inherited from the usual order on $[0,1]$ and a measure induced by the Lebesgue
measure on $[0,1]$; of course, the root, the linear order and the measure
obtained by such a coding have to satisfy some compatibility conditions. In
this paper, we prove that any compact real tree equipped with a root, a linear
order and a measure that are compatible can be encoded by a non-negative
function $h$ defined on a finite interval $[0, M]$, that is assumed to be
left-continuous with right-limit, without positive jump and such that
$h(0+)=h(0)=0$. Moreover, this function is unique if we assume that the
exploration of the tree induced by such a coding backtracks as less as
possible. We also prove that a measure-change on the tree corresponds to a
re-parametrization of the coding function. In addition, we describe several
path-properties of the coding function in terms of the metric properties of the
real tree.
