From: Enno B. <enn...@gm...> - 2013-12-26 10:25:53
|
Hi Helge, > Here are my results on Win7 Prof 64 bit German: > > python -S > > Python 2.7.6 (default, Nov 10 2013, 19:24:18) [MSC v.1500 32 bit > (Intel)] on win32 > >>> import string; print [hex(ord(c)) for c in string.whitespace] > ['0x9', '0xa', '0xb', '0xc', '0xd', '0x20'] Weird, isn't it? No 0xa0 to be seen. Had the same here. Results are different though when you add print ([hex(ord(c)) for c in string.whitespace]) to libgedcom.py. I did that, at the start of __merge_address, and if you do the same, you will probably see that the 0xa0 is there, at position 6. To test this, I installed my Gramps in D:\GrampsAIO in Dutch Windows 8.1, so that Windows doesn't interfere with my mods. I also had to add parentheses to the print, as you can see above. Since 0xA0 is not legal ASCII or Unicode, but is legal in Latin-1, it needs to be either eliminated or converted to Unicode, and the latter is easy by appending .decode('latin_1') to string.whitespace. You have to do that twice in __merge_address. With that mod, import is OK here. I'm not sure how it works out on Windows outside the Latin-1 area, but I hope that someone else can test that too. regards, Enno |