From 6b47f926b99b84b12b2dfc00fa14c87b36bf0618 Mon Sep 17 00:00:00 2001 From: mike Date: Mon, 3 Apr 2006 14:08:29 +0000 Subject: [PATCH] Document character-set translation methods. --- lib/ZOOM.pod | 36 +++++++++++++++++++++++++++++++++--- 1 file changed, 33 insertions(+), 3 deletions(-) diff --git a/lib/ZOOM.pod b/lib/ZOOM.pod index e2aafec..0617ad6 100644 --- a/lib/ZOOM.pod +++ b/lib/ZOOM.pod @@ -1,4 +1,4 @@ -# $Id: ZOOM.pod,v 1.30 2006-03-09 12:57:19 mike Exp $ +# $Id: ZOOM.pod,v 1.31 2006-04-03 14:08:29 mike Exp $ use strict; use warnings; @@ -605,19 +605,24 @@ http://zoom.z3950.org/api/zoom-current.html#3.5 =head4 render() - print $rec->render() + print $rec->render(); + print $rec->render("charset=latin1,utf8"); Returns a human-readable representation of the record. Beyond that, no promises are made: careful programs should not make assumptions about the format of the returned string. +If the optional argument is provided, then it is interpreted as in the +C method (q.v.) + This method is useful mostly for debugging. =head4 raw() - use MARC::Record + use MARC::Record; $raw = $rec->raw(); $marc = new_from_usmarc MARC::Record($raw); + $trans = $rec->render("charset=latin1,utf8"); Returns an opaque blob of data that is the raw form of the record. Exactly what this is, and what you can do with it, varies depending on @@ -627,6 +632,31 @@ that can be decoded by software such as the fine C module; GRS-1 record will be ... gosh, what an interesting question. But no-one uses GRS-1 any more, do they? +If the optional argument is provided, then it is interpreted as in the +C method (q.v.) + +=head4 get() + + $raw = $rec->get("raw"); + $rendered = $rec->get("render"); + $trans = $rec->get("render;charset=latin1,utf8"); + $trans = $rec->get("render", "charset=latin1,utf8"); + +This is the underlying method used by C and C, and +which in turn delegates to the C function of the +underlying ZOOM-C library. Most applications will find it more +natural to work with C and C. + +C may be called with either one or two arguments. The +two-argument form is syntactic sugar: the two arguments are simply +joined with a semi-colon to make a single argument, so the third and +fourth example invocations above are equivalent. The second argument +(or portion of the first argument following the semicolon) is used in +the C argument of C, as described in +http://www.indexdata.com/yaz/doc/zoom.records.tkl +This is useful primarily for invoking the character-set transformation +- in the examples above, from ISO Latin-1 to UTF-8 Unicode. + =head4 clone() / destroy() $rec = $rs->record($i); -- 1.7.10.4