Examples of Charset


Examples of java.nio.charset.Charset

            }
            else
            {
                // canonicalize the charset name and make sure
                // the current platform supports it.
                Charset set = Charset.forName(charsetName);
                address.setPersonal(name, set.name());
            }

            // run sanity check on new InternetAddress object; if this fails
            // it will throw AddressException.
            address.validate();
View Full Code Here

Examples of java.nio.charset.Charset

  private ConnectionCostsBuilder() {
  }
 
  public static ConnectionCostsWriter build(String filename) throws IOException {
    FileInputStream inputStream = new FileInputStream(filename);
    Charset cs = Charset.forName("US-ASCII");
    CharsetDecoder decoder = cs.newDecoder()
        .onMalformedInput(CodingErrorAction.REPORT)
        .onUnmappableCharacter(CodingErrorAction.REPORT);
    InputStreamReader streamReader = new InputStreamReader(inputStream, decoder);
    LineNumberReader lineReader = new LineNumberReader(streamReader);
   
View Full Code Here

Examples of java.nio.charset.Charset

  public UnknownDictionaryWriter readDictionaryFile(String filename, String encoding)
      throws IOException {
    UnknownDictionaryWriter dictionary = new UnknownDictionaryWriter(5 * 1024 * 1024);
   
    FileInputStream inputStream = new FileInputStream(filename);
    Charset cs = Charset.forName(encoding);
    CharsetDecoder decoder = cs.newDecoder()
        .onMalformedInput(CodingErrorAction.REPORT)
        .onUnmappableCharacter(CodingErrorAction.REPORT);
    InputStreamReader streamReader = new InputStreamReader(inputStream, decoder);
    LineNumberReader lineReader = new LineNumberReader(streamReader);
   
View Full Code Here

Examples of org.apache.commons.lang.CharSet

        this.maxSecondsInCache = maxSecondsInCache;
    }

    public void setName( String name )
    {
        CharSet illegal = CharSet.getInstance( ":/\\\"' " );
        for ( int i = 0; i < name.length(); i++ )
        {
            char c = name.charAt( i );
            if ( illegal.contains( c ) )
            {
                throw new IllegalArgumentException( "Name cannot contain characters from the set [" + illegal + "]" );
            }
        }
        this.name = name;
View Full Code Here

Examples of org.axsl.ps.CharSet

                return fsf.getWidths();
            }
            return getSubsetWidths();
        }
        final Encoding encoding = this.fontUse.getEncoding();
        final CharSet charSet = fsf.getCharSet();
        final int firstIndex = encoding.getFirstIndex();
        final int lastIndex = encoding.getLastIndex();
        final int size = lastIndex - firstIndex + 1;
        final short[] widthsByFontIndex = new short[size];
        for (int i = firstIndex; i <= lastIndex; i++) {
            // Decode the character for this index
            final int codePoint = encoding.decodeCharacter(i);
            // Find the charSet index for that character.
            final int charSetIndex = charSet.getIndex(codePoint);
            if (charSetIndex < 0) {
                continue;
            }
            // Find the width for that charSet index.
            final short width = fsf.getWidths()[charSetIndex];
View Full Code Here

Examples of org.hsqldb.types.Charset

        PersistentStore store = session.sessionData.getRowStore(t);
        Iterator it = database.schemaManager.databaseObjectIterator(
            SchemaObject.CHARSET);

        while (it.hasNext()) {
            Charset charset = (Charset) it.next();

            if (!session.getGrantee().isAccessible(charset)) {
                continue;
            }

            Object[] data = t.getEmptyRowData();

            data[character_set_catalog]   = database.getCatalogName().name;
            data[character_set_schema]    = charset.getSchemaName().name;
            data[character_set_name]      = charset.getName().name;
            data[character_repertoire]    = "UCS";
            data[form_of_use]             = "UTF16";
            data[default_collate_catalog] = data[character_set_catalog];

            if (charset.base == null) {
View Full Code Here

Examples of org.hsqldb.types.Charset

                read();
                readThis(Tokens.SET);
                checkIsSchemaObjectName();

                String schemaName = session.getSchemaName(token.namePrefix);
                Charset charset =
                    (Charset) database.schemaManager.getSchemaObject(
                        token.tokenString, schemaName, SchemaObject.CHARSET);

                read();
            }
View Full Code Here

Examples of org.hsqldb.types.Charset

        readIfThis(Tokens.AS);
        readThis(Tokens.GET);

        String schema = session.getSchemaName(token.namePrefix);
        Charset source =
            (Charset) database.schemaManager.getSchemaObject(token.tokenString,
                schema, SchemaObject.CHARSET);

        read();

        if (token.tokenType == Tokens.COLLATION) {
            read();
            readThis(Tokens.FROM);
            readThis(Tokens.DEFAULT);
        }

        Charset charset = new Charset(name);

        charset.base = source.getName();

        String   sql  = getLastPart();
        Object[] args = new Object[]{ charset };
View Full Code Here

Examples of org.hsqldb.types.Charset

            }
            case StatementTypes.CREATE_ASSERTION : {
                return Result.updateZeroResult;
            }
            case StatementTypes.CREATE_CHARACTER_SET : {
                Charset charset = (Charset) arguments[0];

                try {
                    setOrCheckObjectName(session, null, charset.getName(),
                                         true);
                    schemaManager.addSchemaObject(charset);

                    break;
                } catch (HsqlException e) {
View Full Code Here

Examples of org.hsqldb_voltpatches.types.Charset

            }
            case StatementTypes.CREATE_ASSERTION : {
                return Result.updateZeroResult;
            }
            case StatementTypes.CREATE_CHARACTER_SET : {
                Charset charset = (Charset) arguments[0];

                try {
                    setOrCheckObjectName(session, null, charset.getName(),
                                         true);
                    session.database.schemaManager.addSchemaObject(charset);

                    break;
                } catch (HsqlException e) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.