Class EncodingGuesser

java.lang.Object
com.google.refine.importing.EncodingGuesser

public final class EncodingGuesser extends Object
This class tries to find the correct encoding based on https://github.com/albfernandez/juniversalchardet which is a Java port of Mozilla's universalchardet library https://hg.mozilla.org/mozilla-central/file/tip/extensions/universalchardet/
Author:
Steffen Stundzig
  • Field Details

  • Constructor Details

    • EncodingGuesser

      public EncodingGuesser()
  • Method Details

    • guess

      public static void guess(ImportingJob job) throws IOException
      Throws:
      IOException
    • guessEncoding

      public static String guessEncoding(File dir, String location) throws IOException
      Throws:
      IOException
    • guessInitialEncoding

      public static void guessInitialEncoding(List<com.fasterxml.jackson.databind.node.ObjectNode> fileRecords, com.fasterxml.jackson.databind.node.ObjectNode options)
      uses the first found encoding in the file records as initial encoding and put them into the options
      Parameters:
      fileRecords -
      options -