Package org.marc4j.converter.impl

Examples of org.marc4j.converter.impl.AnselToUnicode


        int counter = 0;

        MarcStreamReader reader = new MarcStreamReader(input);
        ByteArrayOutputStream out = new ByteArrayOutputStream();
        MarcStreamWriter writer = new MarcStreamWriter(out, "UTF8");
        writer.setConverter(new AnselToUnicode());
        while (reader.hasNext()) {
            Record record = reader.next();
            writer.write(record);
            counter++;
        }
View Full Code Here


        int counter = 0;

        MarcStreamReader reader = new MarcStreamReader(input);
        ByteArrayOutputStream out = new ByteArrayOutputStream();
        MarcStreamWriter writer = new MarcStreamWriter(out, "UTF8");
        writer.setConverter(new AnselToUnicode());
        while (reader.hasNext()) {
            Record record = reader.next();
            writer.write(record);
            counter++;
        }
View Full Code Here

   
    static AnselToUnicode conv = null;
    private void cleanupBadFieldSeperators(byte[] field)
    {
        if (conv == null) conv = new AnselToUnicode(true);
        boolean hasEsc = false;
        boolean inMultiByte = false;
        boolean justCleaned = false;
        int mbOffset = 0;
       
View Full Code Here

    static byte overbar[] = { (byte)(char)(0xaf) };
    
    private String getMarc8Conversion(byte[] bytes)
    {
        String dataElement = null;
        if (converterAnsel == null) converterAnsel = new AnselToUnicode(errors);           
        if (permissive && (byteArrayContains(bytes, badEsc) || byteArrayContains(bytes, overbar))) 
        {
            String newDataElement = null;
            try
            {
View Full Code Here

        InputStream input = ReadMarcExample.class
                .getResourceAsStream("resources/summerland.mrc");
        MarcReader reader = new MarcStreamReader(input);

        MarcXmlWriter writer = new MarcXmlWriter(result, stylesheet);
        writer.setConverter(new AnselToUnicode());
        while (reader.hasNext()) {
            Record record = (Record) reader.next();
            writer.write(record);
        }
        writer.close();
View Full Code Here

                throw new MarcException("unsupported encoding", e);
            }
        }
        else if (encoding.equals("MARC-8") || encoding.equals("MARC8"))
        {
            if (converterAnsel == null) converterAnsel = new AnselToUnicode();
            dataElement = converterAnsel.convert(bytes);
        }
        else if (encoding.equals("ISO-8859-1") || encoding.equals("ISO8859_1") || encoding.equals("ISO_8859_1"))
        {
            try {
View Full Code Here

        writer.setIndent(true);

        if (convert != null) {
            CharConverter charconv = null;
            if (Constants.MARC_8_ENCODING.equals(convert))
                charconv = new AnselToUnicode();
            else if (Constants.ISO5426_ENCODING.equals(convert))
                charconv = new Iso5426ToUnicode();
            else if (Constants.ISO6937_ENCODING.equals(convert))
                charconv = new Iso6937ToUnicode();
            else {
View Full Code Here

        MarcReader reader = new MarcStreamReader(input);

        DOMResult result = new DOMResult();
        MarcXmlWriter writer = new MarcXmlWriter(result);
        writer.setConverter(new AnselToUnicode());
        while (reader.hasNext()) {
            Record record = (Record) reader.next();
            writer.write(record);
        }
        writer.close();
View Full Code Here

                .getResourceAsStream("resources/summerland.mrc");

        MarcReader reader = new MarcStreamReader(input);
        MarcWriter writer = new MarcXmlWriter(System.out, true);

        AnselToUnicode converter = new AnselToUnicode();
        writer.setConverter(converter);

        while (reader.hasNext()) {
            Record record = reader.next();
            writer.write(record);
View Full Code Here

                .getResourceAsStream("resources/brkrtest.mrc");

        MarcReader reader = new MarcStreamReader(input);
        MarcWriter writer = new MarcStreamWriter(System.out, "UTF8");

        AnselToUnicode converter = new AnselToUnicode();
        writer.setConverter(converter);

        while (reader.hasNext()) {
            Record record = reader.next();
            writer.write(record);
View Full Code Here

TOP

Related Classes of org.marc4j.converter.impl.AnselToUnicode

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.