# Buggy code
def serialize_config(config, image_digests=None):
    return yaml.safe_dump(
        denormalize_config(config, image_digests),
        default_flow_style=False,
        indent=2,
        width=80,
    )


# Traceback (UnicodeDecodeError)
Traceback (most recent call last):
File "/usr/bin/docker-compose", line 11, in <module>
sys.exit(main())
File "/usr/lib/python2.7/site-packages/compose/cli/main.py", line 71, in main
command()
File "/usr/lib/python2.7/site-packages/compose/cli/main.py", line 118, in perform_command
handler(command, options, command_options)
File "/usr/lib/python2.7/site-packages/compose/cli/main.py", line 322, in config
print(serialize_config(compose_config, image_digests))
File "/usr/lib/python2.7/site-packages/compose/config/serialize.py", line 93, in serialize_config
width=80
File "/usr/lib/python2.7/site-packages/yaml/__init__.py", line 218, in safe_dump
return dump_all([data], stream, Dumper=SafeDumper, **kwds)
File "/usr/lib/python2.7/site-packages/yaml/__init__.py", line 190, in dump_all
dumper.represent(data)
File "/usr/lib/python2.7/site-packages/yaml/representer.py", line 28, in represent
node = self.represent_data(data)
File "/usr/lib/python2.7/site-packages/yaml/representer.py", line 57, in represent_data
node = self.yaml_representers[data_types[0]](self, data)
File "/usr/lib/python2.7/site-packages/yaml/representer.py", line 225, in represent_dict
return self.represent_mapping(u'tag:yaml.org,2002:map', data)
File "/usr/lib/python2.7/site-packages/yaml/representer.py", line 123, in represent_mapping
node_value = self.represent_data(item_value)
File "/usr/lib/python2.7/site-packages/yaml/representer.py", line 57, in represent_data
node = self.yaml_representers[data_types[0]](self, data)
File "/usr/lib/python2.7/site-packages/yaml/representer.py", line 225, in represent_dict
return self.represent_mapping(u'tag:yaml.org,2002:map', data)
File "/usr/lib/python2.7/site-packages/yaml/representer.py", line 123, in represent_mapping
node_value = self.represent_data(item_value)
File "/usr/lib/python2.7/site-packages/yaml/representer.py", line 57, in represent_data
node = self.yaml_representers[data_types[0]](self, data)
File "/usr/lib/python2.7/site-packages/yaml/representer.py", line 225, in represent_dict
return self.represent_mapping(u'tag:yaml.org,2002:map', data)
File "/usr/lib/python2.7/site-packages/yaml/representer.py", line 123, in represent_mapping
node_value = self.represent_data(item_value)
File "/usr/lib/python2.7/site-packages/yaml/representer.py", line 57, in represent_data
node = self.yaml_representers[data_types[0]](self, data)
File "/usr/lib/python2.7/site-packages/yaml/representer.py", line 225, in represent_dict
return self.represent_mapping(u'tag:yaml.org,2002:map', data)
File "/usr/lib/python2.7/site-packages/yaml/representer.py", line 123, in represent_mapping
node_value = self.represent_data(item_value)
File "/usr/lib/python2.7/site-packages/yaml/representer.py", line 57, in represent_data
node = self.yaml_representers[data_types[0]](self, data)
File "/usr/lib/python2.7/site-packages/compose/config/serialize.py", line 30, in serialize_string
data = data.replace('$', '$$')
UnicodeDecodeError: ‘ascii’ codec can't decode byte 0xe2 in position 1: ordinal not in range(128)

# Fixed code
def serialize_config(config, image_digests=None):
    return yaml.safe_dump(
        denormalize_config(config, image_digests),
        default_flow_style=False,
        indent=2,
        width=80,
        allow_unicode=True,
    )