At least the Norwegian BIBSYS Z39.50 server delivers records in ISO 8859-1, but that is not an option when you edit Z39.50 servers. Patch coming in a moment!
*** Bug 8081 has been marked as a duplicate of this bug. ***
Broadening the scope of this bug a bit.
Problems: This code in admin/z3950servers.pl was creating separate variables for each encoding: $template->param( $_ . $data->{$_} => 1) for ( qw( syntax encoding ) ); And the corresponding code in the template had to check each of these variables to decide which one should be selected: [% IF ( encodingutf8 ) %] <option value="utf8" selected="selected">UTF-8</option> [% ELSE %] <option value="utf8">UTF-8</option> [% END %] [% IF ( encodingEUC_KR ) %] <option value="EUC-KR" selected="selected">EUC-KR</option> [% ELSE %] <option value="EUC-KR">EUC-KR</option> [% END %] etc. This has a couple of problems: - Encodings with a hyphen ("-") in them create invalid variable names in TT, as seen in Bug 8081 - Adding a new encoding means adding 5 lines to the template My proposed solution creates just one variable for the encoding and sets it to the name of the encoding, thus avoiding the hyphen problem. It also generates the options from a list of encodings (defined in the template), which means that future encodings can just be added to the list.
Created attachment 14875 [details] [review] Bug 9497 - Make it easier to add new encodings for Z39.50 servers and add ISO 8859-1 This patch does three things: - Makes admin/z3950servers.pl create one variable for encoding, not one variable for each encoding - Makes the template create encoding options from a list - Adds ISO 8859-1 to the list of available encodings See the bug for a lengthier description To test: - Apply the patch - Edit one Z39.50 server several times, choosing each available encoding in turn - Check that for each encoding, the correct encoding is shown both in the list of Z39.50 servers and in the dropdown on the edit screen
Created attachment 14876 [details] [review] Bug 9497 - Make it easier to add new encodings for Z39.50 servers and add ISO 8859-1 This patch does three things: - Makes admin/z3950servers.pl create one variable for encoding, not one variable for each encoding - Makes the template create encoding options from a list - Adds ISO 8859-1 to the list of available encodings See the bug for a lengthier description To test: - Apply the patch - Edit one Z39.50 server several times, choosing each available encoding in turn - Check that for each encoding, the correct encoding is shown both in the list of Z39.50 servers and in the dropdown on the edit screen Comment: Works as described, no errors. Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Created attachment 14933 [details] [review] Bug 9497 - Make it easier to add new encodings for Z39.50 servers and add ISO 8859-1 This patch does three things: - Makes admin/z3950servers.pl create one variable for encoding, not one variable for each encoding - Makes the template create encoding options from a list - Adds ISO 8859-1 to the list of available encodings See the bug for a lengthier description To test: - Apply the patch - Edit one Z39.50 server several times, choosing each available encoding in turn - Check that for each encoding, the correct encoding is shown both in the list of Z39.50 servers and in the dropdown on the edit screen Comment: Works as described, no errors. Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> Signed-off-by: Mason James <mtj@kohaaloha.com>
(In reply to comment #6) > Created attachment 14933 [details] [review] > Bug 9497 - Make it easier to add new encodings for Z39.50 servers and add > ISO 8859-1 > > Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> > Signed-off-by: Mason James <mtj@kohaaloha.com> testing 1 commit(s) (applied to f8686e9 'Bug 9116: Remove some useless tmp var') passing QA, works well :)
This patch has been pushed to master.
Pushed to 3.10.x, will be in 3.10.3
Works as expected (tested with packages built off current master).