Java Encode encodePersonal( InternetAddress[] addresses)

Here you can find the source of encodePersonal( InternetAddress[] addresses)

Description

encode Personal

License

Open Source License

Declaration

private static InternetAddress[] encodePersonal(
            InternetAddress[] addresses)
            throws UnsupportedEncodingException 

Method Source Code

//package com.java2s;
/***************************************************************
 *  This file is part of the [fleXive](R) framework.
 *
 *  Copyright (c) 1999-2014/*w ww . j  a va 2s.  c  o m*/
 *  UCS - unique computing solutions gmbh (http://www.ucs.at)
 *  All rights reserved
 *
 *  The [fleXive](R) project is free software; you can redistribute
 *  it and/or modify it under the terms of the GNU Lesser General Public
 *  License version 2.1 or higher as published by the Free Software Foundation.
 *
 *  The GNU Lesser General Public License can be found at
 *  http://www.gnu.org/licenses/lgpl.html.
 *  A copy is found in the textfile LGPL.txt and important notices to the
 *  license from the author are found in LICENSE.txt distributed with
 *  these libraries.
 *
 *  This library is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  For further information about UCS - unique computing solutions gmbh,
 *  please see the company website: http://www.ucs.at
 *
 *  For further information about [fleXive](R), please see the
 *  project website: http://www.flexive.org
 *
 *
 *  This copyright notice MUST APPEAR in all copies of the file!
 ***************************************************************/

import javax.mail.internet.InternetAddress;

import java.io.*;

public class Main {
    private static InternetAddress[] encodePersonal(
            InternetAddress[] addresses)
            throws UnsupportedEncodingException {
        if (addresses == null) {
            return null;
        }
        for (InternetAddress address : addresses) {
            if (address.getPersonal() != null) {
                address.setPersonal(address.getPersonal(), "UTF-8");
            }
        }
        return addresses;
    }
}

Related

  1. encodeObject(final Object object)
  2. encodeObject(Object obj)
  3. encodeOID(byte[] in, OutputStream os)
  4. encodeParameter(String name, String value, String encoding, String lang)
  5. encodePart(final String part, final String charset, final BitSet allowed)
  6. encodeQP(String text)
  7. encodeResult(final Object result)
  8. encodeRGBAsGrayScale(final byte[] raw, final int width, final int height, final int bitsPerPixel, final OutputStream out)
  9. encodeStringBase64(String str)