"Bill" == Bill Janssen <[EMAIL PROTECTED]> writes:
>> Getting the Default charset (no Charset set in command line or
>> plucker.ini) with Python 2.0b1 work fine but using Python 1.52 it does
>> not work. Do you have an idea?
Bill> No, it doesn't work on UNIX either; the locale.getlocale() call isn't
Bill> in 1.5.2. I just punt on that case, and say that the default charset
Bill> is unknown, which is a case we have to handle anyway. Presumably
Bill> people are moving to Python 2.0, 2.1, and real soon now 2.2.
Well i take a closer look and it seams easy to query Windows for the
default codepage and set the default_charset ini key by the installer.
So i do not need take care about the locale.getlocale()[1] function by
Python. BTW: Windows report me the codepage by numbers like 1250,
1251, 1252, ...
So the NamedCharsets array need to be updated.
OK, but there seams a bug in your python code for handling this:
If i call locale.py i get this output:
--------
Language: de_DE
Encoding: cp1252
--------
Thats right, but if i run plucker i get:
----------
Converted plucker:/home.html
Default charset is 1252
----------
That seams also right, but if i edit the line 380 in writer.py in this
way:
--------
print 'Default charset is ' + str(mibenum) + ((charset_name and " (" + charset_name +
")") or "")
print mibenum
print charset_name
-------
i get:
-------
Converted plucker:/home.html
Default charset is 1252
1252
0
Converted plucker:/~special~/index
------
and 04E4 (1252) are written in the plucker DBs metadata record. But
the http://www.iana.org/assignments/character-sets say:
-------------
Name: windows-1252
MIBenum: 2252
Source: Microsoft (see ../character-set-info/windows-1252) [Wendt]
Alias: None
-------------
So i guess that 2252 need to be written in the metadata.
And at the end one idea: Whats about writing a parser that parse the
http://www.iana.org/assignments/character-sets and create and complete
NamedCharsets array? It seams to be easy and i think i could do this.
cu,
Dirk
--
Permanent URLs to the latest Version (1.1.13) of the Plucker Windows installer
- For the Webpage: http://www.dirk-heiser.de/plucker
- Direct Download: http://www.dirk-heiser.de/plucker/plucker.exe [2.08MB]