summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authordumpfmprod <dumpfmprod@ubuntu.(none)>2010-09-22 11:28:47 -0400
committerdumpfmprod <dumpfmprod@ubuntu.(none)>2010-09-22 11:28:47 -0400
commitcf9e9e02175d8eefe1986540f53b22a63f2e3f27 (patch)
tree0e65ba4e8983d08fc8f1f0419842b5b065820ff4 /scripts
parent8033ab41346987d835d20377dc9d13d4f50e392e (diff)
fucking default ascii encoding.
Diffstat (limited to 'scripts')
-rw-r--r--scripts/fill.image_urls.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/scripts/fill.image_urls.py b/scripts/fill.image_urls.py
index 0b1c2e3..7686ecf 100644
--- a/scripts/fill.image_urls.py
+++ b/scripts/fill.image_urls.py
@@ -5,6 +5,7 @@ import postgresql
from urllib.parse import urlparse
db = postgresql.open("pq://postgres:root@localhost/dumpfm")
+db.execute("SET CLIENT_ENCODING to 'UNICODE'")
def get_num_images_in_db():
ps = db.prepare("SELECT COUNT(*) FROM image_urls")
@@ -60,4 +61,4 @@ if __name__ == "__main__":
print("added ", len(urls), " images to db")
num_new_images = get_num_images_in_db() - num_existing_images
percent_new_images = num_new_images / len(urls) * 100
- print(num_new_images, " were new (", percent_new_images ,"%)") \ No newline at end of file
+ print(num_new_images, " were new (", percent_new_images ,"%)")