package siprp.planoactuacao.print;

public class StringConverterUtils 
{
	public static String stripHTMLTags( String text )
	{
		String output = text;
		
		output = output.replaceAll( "<br>", "" );
		output = output.replaceAll( "<p>", "" );
		output = output.replaceAll( "</p>", "" );
		
		return output;
	}
	
	
	public static String convertHTMLToText( String text )
	{
		String output = text;

		output = output.replaceAll( "&Agrave;", "À" );
		output = output.replaceAll( "&Aacute;", "Á" );
		output = output.replaceAll( "&Acirc;", "Â" );
		output = output.replaceAll( "&Atilde;", "Ã" );
		output = output.replaceAll( "&Ccedil;", "Ç" );
		output = output.replaceAll( "&Egrave;", "È" );
		output = output.replaceAll( "&Eacute;", "É" );
		output = output.replaceAll( "&Oacute;", "Ó" );
		output = output.replaceAll( "&Ograve;", "Ò" );

		output = output.replaceAll( "&Ecirc;", "Ê" );
		output = output.replaceAll( "&Igrave;", "Ì" );
		output = output.replaceAll( "&Iacute;", "Í" );
		output = output.replaceAll( "&Icirc;", "Î" );
		output = output.replaceAll( "&Ocirc;", "Ô" );
		output = output.replaceAll( "&Otilde;", "Õ" );
		output = output.replaceAll( "&Ugrave;", "Ù" );
		output = output.replaceAll( "&Uacute;", "Ú" );
		output = output.replaceAll( "&Ucirc;", "Û" );

		output = output.replaceAll( "&agrave;", "à" );
		output = output.replaceAll( "&aacute;", "á" );
		output = output.replaceAll( "&acirc;", "â" );
		output = output.replaceAll( "&atilde;", "ã" );
		output = output.replaceAll( "&ccedil;", "ç" );
		output = output.replaceAll( "&egrave;", "è" );
		output = output.replaceAll( "&eacute;", "é" );
		output = output.replaceAll( "&ecirc;", "ê" );
		output = output.replaceAll( "&igrave;", "ì" );
		output = output.replaceAll( "&iacute;", "í" );
		output = output.replaceAll( "&icirc;", "î" );
		output = output.replaceAll( "&ograve;", "ò" );
		output = output.replaceAll( "&oacute;", "ó" );
		output = output.replaceAll( "&ocirc;", "ô" );
		output = output.replaceAll( "&otilde;", "õ" );
		output = output.replaceAll( "&ugrave", "ù" );
		output = output.replaceAll( "&uacute;", "ú" );
		output = output.replaceAll( "&ucirc;", "û" );

		output = output.replaceAll( "&nbsp;", " " );
		return output;
	}
}
