java.lang.Object
com.perforce.p4java.impl.mapbased.rpc.sys.helper.UnicodeHelper

public class UnicodeHelper extends Object
Provides default and / or bridged (to Eclipse, etc.) Unicode helper methods. May disappear or be moved in a future refactoring.
  • Constructor Details

    • UnicodeHelper

      public UnicodeHelper()
  • Method Details

    • inferCharset

      public static boolean inferCharset(byte[] bytes, int bytesRead, Charset clientCharset)
      Try to determine whether a byte buffer's character encoding is that of the passed-in charset. Uses inefficient heuristics that will be revisited when we're more familiar with likely usage patterns.

      Note this has been heavily changed since inception and will almost certainly disappear in the 10.x timeframe -- HR.

      Parameters:
      bytes - bytes
      bytesRead - bytesRead
      clientCharset - clientCharset
      Returns:
      ok