El 29/01/13 04:49, Mark Allen via RT escribió:
Show quoted text> <URL:
https://rt.cpan.org/Ticket/Display.html?id=80527 >
>
> On Wed Oct 31 11:44:36 2012, explorer@joaquinferrero.com wrote:
>> When perldoc is called using the '-L XX' and '-f' switches, it
>> cannot find the corresponding section of the requested function
>> if the string returned by POD2::XX::search_perlfunc_re() (i.e.
>> the string that marks the beginning of the section in
>> perlfunc.pod that contains the descriptions of the functions
>> available) is not encoded as iso-8859-1.
>>
>> perldoc -L ES perlfunc
>>
>> works, but
>>
>> perldoc -L ES -f chr
>>
>> returns the following error message:
>>
>> No documentation for perl function 'chr' found
>>
>> Interum solution: search_perlfunc_re() should return an
>> iso-8859-1-encoded string fully (or partially) matching the same
>> string that should appear in perlfunc.pod.
>>
>> Proposed solution: The search process of the string returned by
>> search_perlfunc_re() should consider the encoding used for
>> perlfunc.pod.
>>
>> In POD2::ES all the docs are UTF-8-encoded. As a temporary
>> solution, we have fixed this issue by removing characters with
>> diacritic marks:
>>
>> sub search_perlfunc_re {
>> return 'Lista de funciones de Perl en orden';
>> }
>>
>> (removed ‘alfabético’)
>
> There's no easy way to tell what encoding a given file is in reliably,
> so I am wondering if we should have a callback function in POD2::XX like
> search_perlfunc_re_encoding() which returns a string scalar like
> "latin1" or "utf8" or whatever is appropriate.
>
> What do you think about that?
>
> Thanks.
>
> Mark
>
>
>
Yes, it's true.
The Spanish PerlDoc team suggested to change all original English pod documentation to utf8 encoding, but this proposal was not approved. The Spanish version are all utf8 encoded. Other language translation will be.
In this moment, 31 of 169 English pods have the encoding line :)
The best part for this problem is that known that encoding of pod documents is easy: all pod are ISO-8859-1, unless the pod have a =encoding tag, showing the encoding.
The problem now is to make a regex compatible with these encoding, so perldoc can find the start of list of functions in perlfunc.
The search_perlfunc_re_encoding() function would read the first lines of perlfunc.pod and show the encoding, but perldoc can make this operation, also.
Other solution:
1) edit perlfunc.pod, and at line
2) remove all the code about
I will talk with the Spanish PerlDoc team, and we will send you another email.
Best Regards,
JF^D
--
Enviado desde mi teléfono con K-9 Mail.