com.perforce.p4java.server
Class PerforceCharsets

java.lang.Object
  extended by com.perforce.p4java.server.PerforceCharsets

public class PerforceCharsets
extends java.lang.Object

Encapsulates Perforce-wide charset information for servers.

Unfortunately, support for Unicode and associated charsets is somewhat server- and installation-dependent, and not easy to divine unless you're already talking to a Perforce server -- by which time it's too late. This class is an attempt to make it easier to cut that Gordian knot...

Note that the names below are not actually the standard name for the charset in some cases: e.g. UTF-8 should be "utf-8" not "utf8", but we follow the Perforce server's rules here.


Constructor Summary
PerforceCharsets()
           
 
Method Summary
static java.lang.String getJavaCharsetName(java.lang.String p4CharsetName)
          Get Java equivalent charset name for a p4 charset name
static java.lang.String[] getKnownCharsets()
          Get known P4 charsets
static boolean isSupported(java.lang.String p4CharsetName)
          Is the P4 charset name specified supported?
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PerforceCharsets

public PerforceCharsets()
Method Detail

getKnownCharsets

public static java.lang.String[] getKnownCharsets()
Get known P4 charsets

Returns:
- array of p4 charset names

getJavaCharsetName

public static java.lang.String getJavaCharsetName(java.lang.String p4CharsetName)
Get Java equivalent charset name for a p4 charset name

Parameters:
p4CharsetName -
Returns:
- Java charset name

isSupported

public static boolean isSupported(java.lang.String p4CharsetName)
Is the P4 charset name specified supported?

Parameters:
p4CharsetName -
Returns:
- true if supported, false otherwise


Copyright (c) 2008-2010 Perforce Software. All rights reserved.