/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package hu.nir.nmail.jsp.tld;

import hu.nir.nmail.utils.NmailUtility;
import java.io.IOException;
import javax.servlet.jsp.JspWriter;
import javax.servlet.jsp.tagext.SimpleTagSupport;

/**
 *
 * @author attila
 */
public class PrintUTF8 extends SimpleTagSupport {
    private String string;
    
    @Override
    public void doTag() throws IOException {
        JspWriter writer = getJspContext().getOut();
        
        if (string == null) {
            writer.print("");
            return;
        }
        
        string = NmailUtility.toUTF8(string);
        writer.print(string);
    }

    public String getString() {
        return string;
    }

    public void setString(String string) {
        this.string = string;
    }
}
