My favorites | Sign in
Project Home
New issue   Search
for
  Advanced search   Search tips   Subscriptions

Issue 179 attachment: utf-8_dump_load.patch (1.1 KB)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# HG changeset patch
# User He Shiming <heshiming@gmail.com>
# Date 1305360990 -28800
# Node ID 2027b709318f800b03e3c258563a1c365c1f9a66
# Parent 63feefd9e3b694f1dd39fb4a3a9bd8304696a731
Temporary fix to use utf-8 document id in dump/load tool.

diff -r 63feefd9e3b6 -r 2027b709318f couchdb/multipart.py
--- a/couchdb/multipart.py Wed May 11 13:46:41 2011 +0100
+++ b/couchdb/multipart.py Sat May 14 16:16:30 2011 +0800
@@ -68,6 +68,7 @@
line = line.replace(CRLF, '\n')
if line != '\n':
name, value = line.split(':', 1)
+ name = name.decode('utf-8')
headers[name.lower().strip()] = value.strip()
else:
in_headers = False
@@ -172,7 +173,7 @@
for name in sorted(headers.keys()):
self.fileobj.write(name)
self.fileobj.write(': ')
- self.fileobj.write(headers[name])
+ self.fileobj.write(headers[name].encode('utf-8'))
self.fileobj.write(CRLF)
self.fileobj.write(CRLF)

Powered by Google Project Hosting