Changeset 83fa028 in trunk for src/allmydata/util/jsonbytes.py


Ignore:
Timestamp:
2023-11-16T18:53:51Z (17 months ago)
Author:
Itamar Turner-Trauring <itamar@…>
Branches:
master
Children:
7b680b3
Parents:
3ddfb92
Message:

Use the existing Tahoe JSON encoder.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified src/allmydata/util/jsonbytes.py

    r3ddfb92 r83fa028  
    6262    A JSON encoder than can also encode UTF-8 encoded strings.
    6363    """
     64    def default(self, o):
     65        return bytes_to_unicode(False, o)
     66
    6467    def encode(self, o, **kwargs):
    6568        return json.JSONEncoder.encode(
     
    7881    bytes are quoted.
    7982    """
     83    def default(self, o):
     84        return bytes_to_unicode(True, o)
     85
    8086    def encode(self, o, **kwargs):
    8187        return json.JSONEncoder.encode(
Note: See TracChangeset for help on using the changeset viewer.