All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.upokecenter.text.encoders.EncodingReplacement Maven / Gradle / Ivy

Go to download

A Java library that implements character encodings used in Web pages and email.

There is a newer version: 0.6.0
Show newest version
package com.upokecenter.text.encoders;

import java.io.*;
import com.upokecenter.util.*;
import com.upokecenter.text.*;

  public class EncodingReplacement implements ICharacterEncoding {
    private static class Decoder implements ICharacterDecoder {
      private int replacement;

      public int ReadChar(IByteReader transform) {
        if (this.replacement == 0) {
          this.replacement = 1;
          return -2;
        }
        return -1;
      }
    }

    public EncodingReplacement() {
    }

    public ICharacterDecoder GetDecoder() {
      return new Decoder();
    }

    public ICharacterEncoder GetEncoder() {
      return new EncodingUtf8().GetEncoder();
    }
  }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy