  It is well known that constructing codes with good parameters is one of the
most important and fundamental problems in coding theory. Though a great many
of good codes have been produced, most of them are defined over alphabets of
sizes equal to prime powers. In this paper, we provide a new explicit
construction of (q+1)-ary nonlinear codes via rational function fields, where q
is a prime power. Our codes are constructed by evaluations of rational
functions at all the rational places (including the place of "infinity") of the
rational function field. Compared to the rational algebraic geometry codes, the
main difference is that we allow rational functions to be evaluated at pole
places. After evaluating rational functions from a union of Riemann-Roch
spaces, we obtain a family of nonlinear codes with length q+1 over the alphabet
$\mathbb{F}_{q}\cup \{\infty\}$. As a result, our codes have reasonable
parameters as they are very close to the Singleton bound. Furthermore, our
codes have better parameters than those obtained from MDS codes via code
alphabet restriction or extension.
