# Path: mom/codec/text.py
# def utf8_encode(unicode_text):
# def utf8_decode(utf8_encoded_bytes):
# def utf8_encode_if_unicode(obj):
# def utf8_decode_if_bytes(obj):
# def to_unicode_if_bytes(obj, encoding="utf-8"):
# def bytes_to_unicode(raw_bytes, encoding="utf-8"):
# def utf8_encode_recursive(obj):
# def bytes_to_unicode_recursive(obj, encoding="utf-8"):
# def utf8_decode_recursive(obj):
# def ascii_encode(obj):
# def latin1_encode(obj):


from mom.codec import text
      from django.utils import simplejson as json
  import json
    import simplejson as json

try:
  # Built-in JSON library.

  assert hasattr(json, "loads") and hasattr(json, "dumps")

  def json_loads(value):
    """Wrapper to decode JSON."""
    return json.loads(value)

  def json_dumps(value):
    """Wrapper to encode JSON."""
    return json.dumps(value)
except (AssertionError, ImportError):
  try:
    # Try to use the simplejson library.

    def json_loads(value):
      """Wrapper to decode JSON."""
      return json.loads(text.utf8_decode(value))

    def json_dumps(value):
      """Wrapper to encode JSON."""
      return json.dumps(value)
  except ImportError:
    try:
      # For Google App Engine.

      def json_loads(value):
        """Wrapper to decode JSON."""

# Path: mom/codec/text.py
# def utf8_encode(unicode_text):
# def utf8_decode(utf8_encoded_bytes):
# def utf8_encode_if_unicode(obj):
# def utf8_decode_if_bytes(obj):
# def to_unicode_if_bytes(obj, encoding="utf-8"):
# def bytes_to_unicode(raw_bytes, encoding="utf-8"):
# def utf8_encode_recursive(obj):
# def bytes_to_unicode_recursive(obj, encoding="utf-8"):
# def utf8_decode_recursive(obj):
# def ascii_encode(obj):
# def latin1_encode(obj):


# Path: mom/codec/_json_compat.py
from mom.codec import text
      from django.utils import simplejson as json
  import json
    import simplejson as json


try:
  # Built-in JSON library.

  assert hasattr(json, "loads") and hasattr(json, "dumps")

  def json_loads(value):
    """Wrapper to decode JSON."""
    return json.loads(value)

  def json_dumps(value):
    """Wrapper to encode JSON."""
    return json.dumps(value)
except (AssertionError, ImportError):
  try:
    # Try to use the simplejson library.

    def json_loads(value):
      """Wrapper to decode JSON."""
      return json.loads(text.utf8_decode(value))

    def json_dumps(value):
      """Wrapper to encode JSON."""
      return json.dumps(value)
  except ImportError:
    try:
      # For Google App Engine.

      def json_loads(value):
        """Wrapper to decode JSON."""

        return json.loads(text.utf8_decode(value))