<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def EncodeUnicode(text):
 """ Optionally encode text and return it. The result should be safe to print. """

  if type(text) == type(u''):
    return text.encode(OUTPUT_ENCODING)
  else:
    return text