Paste number 44057: ruby-zoom raw method

Paste number 44057: ruby-zoom raw method
Pasted by: jaron
1 year, 6 months ago
#code4lib
Paste contents:
Raw Source | XML | Display As
require 'rubygems'
require 'zoom'
require 'marc'

ZOOM::Connection.open('z3950.loc.gov', 7090) do |conn|
    conn.database_name = 'Voyager'
    conn.preferred_record_syntax = 'USMARC'
    rset = conn.search('@attr 1=7 0253333490')
    
    #use the raw method to convert character encoding and feed
    #ISO2709 MARC record into ruby-marc
    marc = MARC::Record.new_from_marc(rset[0].raw('MARC-8', 'UTF-8'))
    
    marc.leader[9, 1] = 'a' #change leader 9 since now UTF-8
    puts marc
end

This paste has no annotations.

Colorize as:
Show Line Numbers

Lisppaste pastes can be made by anyone at any time. Imagine a fearsomely comprehensive disclaimer of liability. Now fear, comprehensively.