001    package railo.runtime.functions.international;
002    
003    import railo.runtime.PageContext;
004    import railo.runtime.exp.FunctionException;
005    import railo.runtime.ext.function.Function;
006    
007    /**
008     * Implements the CFML Function getEncoding
009     */
010    public final class GetEncoding implements Function {
011            public static String call(PageContext pc , String scope) throws FunctionException {
012            scope=scope.trim().toLowerCase();
013            
014            if(scope.equals("url"))return (pc.urlScope()).getEncoding();
015            if(scope.equals("form"))return (pc.formScope()).getEncoding();
016            throw new FunctionException(pc,"getEncoding",1,"scope","scope must have the one of the following values [url,form] not ["+scope+"]");
017            
018            }
019    }