chiark / gitweb /
Fix charset problems; support Opal and Jade
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Tue, 1 Sep 2009 16:52:10 +0000 (17:52 +0100)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Tue, 1 Sep 2009 16:52:10 +0000 (17:52 +0100)
yarrg/TODO
yarrg/source-info.txt
yarrg/update-master-info
yarrg/yppedia-ocean-scraper

index c824e386e7802b6885e04ceb317729a6b86027b5..6d1412d0670163efe23c69d77e193efb394f523b 100644 (file)
@@ -14,16 +14,13 @@ DATABASE/DICTIONARY MANAGER
        eliminate black dye from live database
 
 O N    yppedia distance scraper finish
-       BUGS    - Sage fails with a `no possible target' (line 321)
-               - copyright and usage info about update-master-info needed
+       copyright and usage info about update-master-info needed
 
        when update rejected print better error message including
         broken commodity name
 
        notice commodities deleted from source-info and warn about them
 
-       support Jade and Opal (UTF-8 trouble with Python ?!)
-
 WEBSITE
 -------
 
index f39e21b032a68a3367c28f91e5c588182e5dbdc3..e63eee76e37ccfa947b74c7b7af1856c68cc9bbd 100644 (file)
@@ -123,6 +123,11 @@ commods
  wood                  175kg 250l
 
 
+client ypp-sc-tools yarrg
+ lastpage
+
+
+#---------- OCEANS ----------
 # subscriber oceans
 
 ocean Midnight
@@ -158,9 +163,16 @@ ocean Viridian
 ocean Crimson
 
 # International oceans (doubloon oceans)
-# broken due to charset problems
-#ocean Jade
-#ocean Opal
 
-client ypp-sc-tools yarrg
- lastpage
+ocean Jade
+ Cigüeña
+  Isla Scrimshaw
+ Ibis
+  Isla Kiwara
+ Águila
+  Cayo Escorbuto
+
+ocean Opal
+ Canis
+  Atchafalaya-Insel
+
index 3f570a68f26b3a75e297d107a3e7e1de4953550d..3515bff78fbf4ae16a250248801cc08acc2239de 100755 (executable)
@@ -4,6 +4,7 @@ use strict (qw(vars));
 use DBI;
 use Commods;
 
+$ENV{'LC_CTYPE'}= 'en_GB.UTF-8';
 
 sub full ($) {
     my ($ocean) = @_;
index a85403504aae52764a1a6d96f7202f6444c005ed..476c1cd9b381bb0d5d5ec1979cc4928bff9fa9f4 100755 (executable)
@@ -42,6 +42,23 @@ import re as regexp
 from optparse import OptionParser
 from BeautifulSoup import BeautifulSoup
 
+
+# For fuck's sake!
+import codecs
+import locale
+def fix_stdout():
+    sys.stdout = codecs.EncodedFile(sys.stdout, locale.getpreferredencoding())
+    def null_decode(input, errors='strict'):
+        return input, len(input)
+    sys.stdout.decode = null_decode
+# From
+#  http://ewx.livejournal.com/457086.html?thread=3016574
+#  http://ewx.livejournal.com/457086.html?thread=3016574
+# lightly modified.
+# See also Debian #415968.
+fix_stdout()
+
+
 ocean = None
 soup = None
 opts = None