package com.vgo.movie.thread;
import java.awt.Cursor;
import java.awt.Image;
import java.io.File;
import java.sql.SQLException;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.Properties;
import javax.swing.ImageIcon;
import javax.swing.JComboBox;
import javax.swing.JOptionPane;
import javax.swing.SwingUtilities;
import javax.swing.table.DefaultTableModel;
import org.htmlparser.Node;
import org.htmlparser.Parser;
import org.htmlparser.filters.NodeClassFilter;
import org.htmlparser.tags.Div;
import org.htmlparser.tags.LinkTag;
import org.htmlparser.tags.TitleTag;
import org.htmlparser.util.NodeList;
import org.htmlparser.util.ParserException;
import com.vgo.movie.data.DatabaseDAO;
import com.vgo.movie.domain.Acteurs;
import com.vgo.movie.domain.Generique;
import com.vgo.movie.ecran.DetailFilm;
import com.vgo.movie.util.FileDownload;
import com.vgo.movie.util.Libelle;
public class DetailFilmThread extends Thread{
DetailFilm localParent = null;
String urlFilm = null;
Image logoImdb = null;
public DetailFilmThread(DetailFilm parent){
localParent = parent;
}
public void initialize() {
this.start();
}
public void run() {
localParent.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
try {
Generique tmp = new Generique();
tmp.setId("useProxy");
tmp = (Generique)DatabaseDAO.selectParametre(tmp);
if(tmp.getCode().equals("O")){
//Param�trer le proxy
Properties systemSettings = System.getProperties();
tmp = new Generique();
tmp.setId("http.proxyHost");
tmp = (Generique)DatabaseDAO.selectParametre(tmp);
if(tmp.getCode() != null && !tmp.getCode().equals(""))
systemSettings.put("http.proxyHost", tmp.getCode());
tmp = new Generique();
tmp.setId("http.proxyPort");
tmp = (Generique)DatabaseDAO.selectParametre(tmp);
if(tmp.getCode() != null && !tmp.getCode().equals(""))
systemSettings.put("http.proxyPort", tmp.getCode());
tmp = new Generique();
tmp.setId("http.proxyUser");
tmp = (Generique)DatabaseDAO.selectParametre(tmp);
if(tmp.getCode() != null && !tmp.getCode().equals(""))
systemSettings.put("http.proxyUser", tmp.getCode());
tmp = new Generique();
tmp.setId("http.proxyPassword");
tmp = (Generique)DatabaseDAO.selectParametre(tmp);
if(tmp.getCode() != null && !tmp.getCode().equals(""))
systemSettings.put("http.proxyPassword", tmp.getCode());
System.setProperties(systemSettings);
}
} catch (SQLException e) {
JOptionPane.showOptionDialog(
SwingUtilities.getWindowAncestor(localParent),
Libelle.getLibelle("erreurRecuperationParametre"),
Libelle.getLibelle("erreur"),
JOptionPane.DEFAULT_OPTION,
JOptionPane.ERROR_MESSAGE,
null,
null,
null);
}
localParent.getJProgressBar().setMaximum(200);
localParent.getJProgressBar().setValue(10);
try {
trouverLiens();
} catch (Exception e) {
JOptionPane.showOptionDialog(
SwingUtilities.getWindowAncestor(localParent),
Libelle.getLibelle("erreurConnexion"),
Libelle.getLibelle("erreur"),
JOptionPane.DEFAULT_OPTION,
JOptionPane.ERROR_MESSAGE,
null,
null,
null);
}
localParent.getJProgressBar().setValue(20);
if(urlFilm != null){
File tmpCacheDir = new File(".cacheMovieDbSl");
if(!tmpCacheDir.exists()){
try {
if(!tmpCacheDir.mkdirs()){
throw new Exception();
}
} catch (Exception e) {
JOptionPane.showOptionDialog(
SwingUtilities.getWindowAncestor(localParent),
Libelle.getLibelle("erreurCreationRepertoire"),
Libelle.getLibelle("erreur"),
JOptionPane.DEFAULT_OPTION,
JOptionPane.ERROR_MESSAGE,
null,
null,
null);
}
}
try {
localParent.afficherLogoImdb(FileDownload.download("http://i.imdb.com/images/nb15/logo.gif"));
localParent.getJProgressBar().setValue(localParent.getJProgressBar().getValue()+10);
} catch (Exception e) {
}
try {
recupererInfoFilm();
} catch (Exception e) {
JOptionPane.showOptionDialog(
SwingUtilities.getWindowAncestor(localParent),
Libelle.getLibelle("erreurConnexion"),
Libelle.getLibelle("erreur"),
JOptionPane.DEFAULT_OPTION,
JOptionPane.ERROR_MESSAGE,
null,
null,
null);
}
localParent.getJProgressBar().setValue(localParent.getJProgressBar().getMaximum());
}
else{
localParent.getJProgressBar().setValue(localParent.getJProgressBar().getMaximum());
}
localParent.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
}
private void trouverLiens() throws Exception{
Parser parser;
NodeList listUrlNode;
NodeList listTitleNode;
String tmpString;
String tmpLien;
String tmpValeur;
LinkedList<HashMap> listUrl = new LinkedList<HashMap>();
HashMap<String, String> tmpHashMap;
String tmpRecherche;
int i=0;
try {
tmpRecherche = "http://www.imdb.com/find?s=tt&q=" + localParent.getJValeurNom().getText().replaceAll(" ", "+");
parser = new Parser(tmpRecherche);
listTitleNode = parser.extractAllNodesThatMatch(new NodeClassFilter (TitleTag.class));
//On commence par d�tecter le titre
for(i = 0;i < listTitleNode.size(); i++){
tmpString = listTitleNode.elementAt(i).toHtml();
if(tmpString.indexOf("IMDb Title Search") <= -1){
urlFilm = tmpRecherche;
}
}
if(urlFilm == null){
parser.reset();
parser.setResource(tmpRecherche);
listUrlNode = parser.extractAllNodesThatMatch (new NodeClassFilter (LinkTag.class));
//On d�tecte d'abord les liens
for (i = 0; i < listUrlNode.size(); i++){
tmpString = listUrlNode.elementAt(i).toHtml();
tmpLien = tmpString.substring(tmpString.indexOf("<a href=")+9, tmpString.indexOf(">")-1);
if(tmpLien.startsWith("/title/")){
tmpValeur = replaceHtmlCode(tmpString.substring(tmpString.indexOf(">")+1, tmpString.indexOf("</a>")));
tmpHashMap = new HashMap<String, String>();
tmpHashMap.put("Nom",tmpValeur);
tmpHashMap.put("URL",new String("http://www.imdb.com" + tmpLien));
listUrl.add(tmpHashMap);
}
}
Object[] message = new Object[2];
message[0] = Libelle.getLibelle("choisirFilm");
JComboBox cb = new JComboBox();
for (HashMap<String,String> hashMap : listUrl) {
cb.addItem(hashMap.get("Nom"));
}
message[1] = cb;
// Options
String[] options = { Libelle.getLibelle("ok")};
JOptionPane.showOptionDialog(
localParent, // the parent that the dialog blocks
message, // the dialog message array
Libelle.getLibelle("choisirFilm"), // the title of the dialog window
JOptionPane.DEFAULT_OPTION, // option type
JOptionPane.INFORMATION_MESSAGE, // message type
null, // optional icon, use null to use the default icon
options, // options string array, will be made into buttons
options[0] // option that should be made into a default button
);
cb = (JComboBox)message[1];
urlFilm = (String)((HashMap)(listUrl.get(cb.getSelectedIndex()))).get("URL");
}
}
catch (ParserException e)
{
throw e;
}
}
private void recupererInfoFilm() throws Exception{
Parser divParser;
NodeList listDiv;
Node tmpNode;
boolean acteursVu = false;
boolean titreVu = false;
boolean realisateurVu = false;
boolean paysVu = false;
boolean tempsVu = false;
boolean genreVu = false;
boolean awardsVu = false;
boolean dateSortieVue = false;
boolean imageVues = false;
int indexDeb = 0;
int indexFin = 0;
try{
divParser = new Parser(urlFilm);
listDiv = divParser.extractAllNodesThatMatch (new NodeClassFilter (Div.class));
for (int i = 0; i < listDiv.size(); i++){
NodeList tmpDivNodeContent = listDiv.elementAt(i).getChildren();
if(tmpDivNodeContent != null){
for(int j = 0; j< tmpDivNodeContent.size(); j++){
tmpNode = tmpDivNodeContent.elementAt(j);
if(tmpNode.toHtml().indexOf("alt=\"Cast\"") > -1 && !acteursVu){
LinkedList<Acteurs> tmpListActeur = new LinkedList<Acteurs>();
Acteurs tmpActeur = null;
String tmpContenu = tmpNode.toHtml().toString();
if(tmpContenu.indexOf("<table class=\"cast\">") >-1 && tmpContenu.indexOf("<table class=\"cast\">") < tmpContenu.indexOf("</table>",tmpContenu.indexOf("<table class=\"cast\">"))){
tmpContenu = tmpContenu.substring(tmpContenu.indexOf("<table class=\"cast\">"),tmpContenu.indexOf("</table>",tmpContenu.indexOf("<table class=\"cast\">")));
String tmpLigne = null;
indexDeb = 0;
indexFin = 0;
while(tmpContenu.indexOf("<tr class=\"odd\">") > -1 || tmpContenu.indexOf("<tr class=\"even\">") > -1){
indexDeb = tmpContenu.indexOf("<tr class=");
indexFin = tmpContenu.indexOf("</tr>", indexDeb+3)+5;
tmpLigne = tmpContenu.substring(indexDeb, indexFin);
tmpActeur = new Acteurs();
try {
indexDeb = tmpLigne.indexOf("<img src=\"") + 10 ;
indexFin = tmpLigne.indexOf("\"", indexDeb);
tmpActeur.setImage(tmpLigne.substring(indexDeb, indexFin));
indexDeb = tmpLigne.indexOf("\">",tmpLigne.indexOf("<td class=\"nm\"><a href=\"")+18) + 2;
indexFin = tmpLigne.indexOf("</a></td>", indexDeb);
tmpActeur.setActeur(replaceHtmlCode(tmpLigne.substring(indexDeb, indexFin)));
indexDeb = tmpLigne.indexOf("<td class=\"char\">")+ 17;
indexFin = tmpLigne.indexOf("</td>", indexDeb);
tmpActeur.setPersonnage(replaceHtmlCode(tmpLigne.substring(indexDeb, indexFin)));
tmpListActeur.add(tmpActeur);
} catch (IndexOutOfBoundsException e) {
//do nothing
}
tmpContenu = tmpContenu.substring(indexFin);
indexDeb = 0;
indexFin = 0;
}
}
localParent.getJProgressBar().setValue(localParent.getJProgressBar().getValue()+20);
int facteur = 20 / tmpListActeur.size();
for (Acteurs tmpActeur2 : tmpListActeur) {
Object[] data = {new ImageIcon(FileDownload.download(tmpActeur2.getImage())),
tmpActeur2.getActeur(),
tmpActeur2.getPersonnage()};
((DefaultTableModel)localParent.getJTableActeurs().getModel()).addRow(data);
localParent.getJProgressBar().setValue(localParent.getJProgressBar().getValue()+facteur);
}
acteursVu = true;
}
if(tmpNode.toHtml().toString().startsWith("<div id=\"tn15crumbs\">") && !titreVu){
/*Titre du Film*/
String tmpContenu = tmpNode.toHtml().toString();
if(tmpContenu.indexOf("<b>") >= 0){
localParent.setValeurNomIdmb(replaceHtmlCode(tmpContenu.substring(tmpContenu.indexOf("<b>")+3,tmpContenu.indexOf("</b>"))));
localParent.getJProgressBar().setValue(localParent.getJProgressBar().getValue()+10);
}
titreVu = true;
}
if (tmpNode.toHtml().toString().indexOf("Director:") > -1 && tmpNode.toHtml().toString().startsWith("<div class=\"info\">") && !realisateurVu){
localParent.setValeurRealisateur(extractValeur(tmpNode.toHtml()));
localParent.getJProgressBar().setValue(localParent.getJProgressBar().getValue()+10);
realisateurVu = true;
}
if (tmpNode.toHtml().toString().indexOf("Country:") > -1 && tmpNode.toHtml().toString().startsWith("<div class=\"info\">") && !paysVu){
localParent.setValeurPays(extractValeur(tmpNode.toHtml()));
localParent.getJProgressBar().setValue(localParent.getJProgressBar().getValue()+10);
paysVu = true;
}
if (tmpNode.toHtml().toString().indexOf("Runtime:") > -1 && tmpNode.toHtml().toString().startsWith("<div class=\"info\">") && !tempsVu){
localParent.setValeurDuree(extractValeur(tmpNode.toHtml()));
localParent.getJProgressBar().setValue(localParent.getJProgressBar().getValue()+10);
tempsVu = true;
}
if (tmpNode.toHtml().toString().indexOf("Genre:") > -1 && tmpNode.toHtml().toString().startsWith("<div class=\"info\">") && !genreVu){
localParent.setValeurGenre(extractValeur(tmpNode.toHtml()));
localParent.getJProgressBar().setValue(localParent.getJProgressBar().getValue()+10);
genreVu = true;
}
if (tmpNode.toHtml().toString().indexOf("Awards:") > -1 && tmpNode.toHtml().toString().startsWith("<div class=\"info\">") && !awardsVu){
localParent.setValeurRecompenses(extractValeur(tmpNode.toHtml()));
localParent.getJProgressBar().setValue(localParent.getJProgressBar().getValue()+10);
awardsVu = true;
}
if (tmpNode.toHtml().toString().indexOf("Release Date:") > -1 && tmpNode.toHtml().toString().startsWith("<div class=\"info\">") && !dateSortieVue){
localParent.setValeurDateSortie(extractValeur(tmpNode.toHtml()));
localParent.getJProgressBar().setValue(localParent.getJProgressBar().getValue()+10);
dateSortieVue = true;
}
if (tmpNode.toHtml().toString().startsWith("<div id=\"tn15recent\">") && !imageVues){
/* Les Photos */
String tmpContenu = tmpNode.toHtml().toString();
int numImage = 0;
indexDeb = 0;
indexFin = 0;
while (tmpContenu.indexOf("<img src=\"http://i.") >=0 && numImage <= 3){
indexDeb = tmpContenu.toLowerCase().indexOf("<img src=\"http://i.") + 10;
indexFin = tmpContenu.toLowerCase().indexOf("\"", indexDeb);
String tmpImage = tmpContenu.substring(indexDeb, indexFin);
tmpContenu = tmpContenu.replaceAll(tmpImage, "");
if(tmpImage.endsWith(".jpg")){
numImage++;
if(numImage == 1){
localParent.afficherImage1(FileDownload.download(tmpImage));
localParent.getJProgressBar().setValue(localParent.getJProgressBar().getValue()+10);
}
if(numImage == 2){
localParent.afficherImage2(FileDownload.download(tmpImage));
localParent.getJProgressBar().setValue(localParent.getJProgressBar().getValue()+10);
}
if(numImage == 3){
localParent.afficherImage3(FileDownload.download(tmpImage));
localParent.getJProgressBar().setValue(localParent.getJProgressBar().getValue()+10);
}
}
}
imageVues = true;
}
tmpNode = null;
}
}
}
}
catch (ParserException e){
throw e;
}
}
private String extractValeur(String div){
String retour = new String();
String tmpString;
int begin;
int end;
/*On extrait tout le contenu en </H5> et </DIV>*/
begin = div.toLowerCase().indexOf("</h5>") + "</h5>".length();
end = div.toLowerCase().lastIndexOf("</div>");
if(begin > -1 && end >= begin){
tmpString = div.substring(begin, end);
retour = tmpString.replaceAll("\n", "");
/*Nettoyage des balises HTML*/
while(retour.indexOf("<") > -1){
begin = retour.indexOf("<");
end = retour.indexOf(">", begin);
retour = retour.replaceAll(retour.substring(begin, end+1), "");
}
}
retour = retour.trim();
if(retour.endsWith("more")){
retour = retour.substring(0, retour.lastIndexOf("more"));
}
return replaceHtmlCode(retour);
}
private String replaceHtmlCode(String input){
String output = input;
output = output.replaceAll("" ", "\"");
output = output.replaceAll("& ", "&" );
output = output.replaceAll("€", "�" );
output = output.replaceAll("", "?" );
output = output.replaceAll("‚", "�" );
output = output.replaceAll("ƒ", "�" );
output = output.replaceAll("„", "�" );
output = output.replaceAll("…", "�" );
output = output.replaceAll("†", "�" );
output = output.replaceAll("‡", "�" );
output = output.replaceAll("ˆ", "�" );
output = output.replaceAll("‰", "�" );
output = output.replaceAll("Š", "�" );
output = output.replaceAll("‹", "�" );
output = output.replaceAll("Œ", "�" );
output = output.replaceAll("", "?" );
output = output.replaceAll("Ž", "�" );
output = output.replaceAll("", "?" );
output = output.replaceAll("", "?" );
output = output.replaceAll("‘", "�" );
output = output.replaceAll("’", "�" );
output = output.replaceAll("“", "�" );
output = output.replaceAll("”", "�" );
output = output.replaceAll("•", "�" );
output = output.replaceAll("–", "�" );
output = output.replaceAll("—", "�" );
output = output.replaceAll("˜", "�" );
output = output.replaceAll("™", "�" );
output = output.replaceAll("š", "�" );
output = output.replaceAll("›", "�" );
output = output.replaceAll("œ", "�" );
output = output.replaceAll("", "?" );
output = output.replaceAll("ž", "�" );
output = output.replaceAll("Ÿ", "�" );
output = output.replaceAll(" ", " " );
output = output.replaceAll("¡", "�" );
output = output.replaceAll("¢", "�" );
output = output.replaceAll("£", "�" );
output = output.replaceAll("¤", "�" );
output = output.replaceAll("¥", "�" );
output = output.replaceAll("¦", "�" );
output = output.replaceAll("§", "�" );
output = output.replaceAll("¨", "�" );
output = output.replaceAll("©", "�" );
output = output.replaceAll("ª", "�" );
output = output.replaceAll("«", "�" );
output = output.replaceAll("¬", "�" );
output = output.replaceAll("­", "�" );
output = output.replaceAll("®", "�" );
output = output.replaceAll("¯", "�" );
output = output.replaceAll("°", "�" );
output = output.replaceAll("±", "�" );
output = output.replaceAll("²", "�" );
output = output.replaceAll("³", "�" );
output = output.replaceAll("´", "�" );
output = output.replaceAll("µ", "�" );
output = output.replaceAll("¶", "�" );
output = output.replaceAll("·", "�" );
output = output.replaceAll("¸", "�" );
output = output.replaceAll("¹", "�" );
output = output.replaceAll("º", "�" );
output = output.replaceAll("»", "�" );
output = output.replaceAll("¼", "�" );
output = output.replaceAll("½", "�" );
output = output.replaceAll("¾", "�" );
output = output.replaceAll("¿", "�" );
output = output.replaceAll("À", "�" );
output = output.replaceAll("Á", "�" );
output = output.replaceAll("Â", "�" );
output = output.replaceAll("Ã", "�" );
output = output.replaceAll("Ä", "�" );
output = output.replaceAll("Å", "�" );
output = output.replaceAll("Æ ", "�" );
output = output.replaceAll("Ç", "�" );
output = output.replaceAll("È", "�" );
output = output.replaceAll("É", "�" );
output = output.replaceAll("Ê", "�" );
output = output.replaceAll("Ë", "�" );
output = output.replaceAll("Ì", "�" );
output = output.replaceAll("Í", "�" );
output = output.replaceAll("Î", "�" );
output = output.replaceAll("Ï", "�" );
output = output.replaceAll("Ð", "�" );
output = output.replaceAll("Ñ", "�" );
output = output.replaceAll("Ò", "�" );
output = output.replaceAll("Ó", "�" );
output = output.replaceAll("Ô", "�" );
output = output.replaceAll("Õ", "�" );
output = output.replaceAll("Ö", "�" );
output = output.replaceAll("×", "�" );
output = output.replaceAll("Ø", "�" );
output = output.replaceAll("Ù", "�" );
output = output.replaceAll("Ú", "�" );
output = output.replaceAll("Û", "�" );
output = output.replaceAll("Ü", "�" );
output = output.replaceAll("Ý", "�" );
output = output.replaceAll("Þ", "�" );
output = output.replaceAll("ß", "�" );
output = output.replaceAll("à", "�" );
output = output.replaceAll("á", "�" );
output = output.replaceAll("â", "�" );
output = output.replaceAll("ã", "�" );
output = output.replaceAll("ä", "�" );
output = output.replaceAll("å", "�" );
output = output.replaceAll("æ", "�" );
output = output.replaceAll("ç", "�" );
output = output.replaceAll("è", "�" );
output = output.replaceAll("é", "�" );
output = output.replaceAll("ê", "�" );
output = output.replaceAll("ë", "�" );
output = output.replaceAll("ì", "�" );
output = output.replaceAll("í", "�" );
output = output.replaceAll("î", "�" );
output = output.replaceAll("ï", "�" );
output = output.replaceAll("ð", "�" );
output = output.replaceAll("ñ", "�" );
output = output.replaceAll("ò", "�" );
output = output.replaceAll("ó", "�" );
output = output.replaceAll("ô", "�" );
output = output.replaceAll("õ", "�" );
output = output.replaceAll("ö", "�" );
output = output.replaceAll("÷", "�" );
output = output.replaceAll("ø", "�" );
output = output.replaceAll("ù", "�" );
output = output.replaceAll("ú", "�" );
output = output.replaceAll("û", "�" );
output = output.replaceAll("ü", "�" );
output = output.replaceAll("ý", "�" );
output = output.replaceAll("þ", "�" );
output = output.replaceAll("ÿ", "�" );
output = output.replaceAll(""", "\"");
output = output.replaceAll("&", " & " );
output = output.replaceAll("€", "�" );
output = output.replaceAll("<", "�" );
output = output.replaceAll(">", "�" );
output = output.replaceAll("œ", "�" );
output = output.replaceAll("Ÿ", "�" );
output = output.replaceAll(" ", " " );
output = output.replaceAll("¡", "�" );
output = output.replaceAll("¢", "�" );
output = output.replaceAll("£", "�" );
output = output.replaceAll("¤", "�" );
output = output.replaceAll("¥", "�" );
output = output.replaceAll("¦", "�" );
output = output.replaceAll("§", "�" );
output = output.replaceAll("¨", "�" );
output = output.replaceAll("©", "�" );
output = output.replaceAll("ª", "�" );
output = output.replaceAll("«", "�" );
output = output.replaceAll("¬", "�" );
output = output.replaceAll("­", "�" );
output = output.replaceAll("®", "�" );
output = output.replaceAll("&masr;", "�" );
output = output.replaceAll("°", "�" );
output = output.replaceAll("±", "�" );
output = output.replaceAll("²", "�" );
output = output.replaceAll("³", "�" );
output = output.replaceAll("´", "�" );
output = output.replaceAll("µ", "�" );
output = output.replaceAll("¶", "�" );
output = output.replaceAll("·", "�" );
output = output.replaceAll("¸", "�" );
output = output.replaceAll("¹", "�" );
output = output.replaceAll("º", "�" );
output = output.replaceAll("»", "�" );
output = output.replaceAll("¼", "�" );
output = output.replaceAll("½", "�" );
output = output.replaceAll("¾", "�" );
output = output.replaceAll("¿", "�" );
output = output.replaceAll("À", "�" );
output = output.replaceAll("Á", "�" );
output = output.replaceAll("Â", "�" );
output = output.replaceAll("Ã", "�" );
output = output.replaceAll("Ä", "�" );
output = output.replaceAll("Å", "�" );
output = output.replaceAll("&Aelig;", "�" );
output = output.replaceAll("Ç", "�" );
output = output.replaceAll("È", "�" );
output = output.replaceAll("É", "�" );
output = output.replaceAll("Ê", "�" );
output = output.replaceAll("Ë", "�" );
output = output.replaceAll("Ì", "�" );
output = output.replaceAll("Í", "�" );
output = output.replaceAll("Î", "�" );
output = output.replaceAll("Ï", "�" );
output = output.replaceAll("ð", "�" );
output = output.replaceAll("Ñ", "�" );
output = output.replaceAll("Ò", "�" );
output = output.replaceAll("Ó", "�" );
output = output.replaceAll("Ô", "�" );
output = output.replaceAll("Õ", "�" );
output = output.replaceAll("Ö", "�" );
output = output.replaceAll("×", "�" );
output = output.replaceAll("Ø", "�" );
output = output.replaceAll("Ù", "�" );
output = output.replaceAll("Ú", "�" );
output = output.replaceAll("Û", "�" );
output = output.replaceAll("Ü", "�" );
output = output.replaceAll("Ý", "�" );
output = output.replaceAll("þ", "�" );
output = output.replaceAll("ß", "�" );
output = output.replaceAll("à", "�" );
output = output.replaceAll("á", "�" );
output = output.replaceAll("â", "�" );
output = output.replaceAll("ã", "�" );
output = output.replaceAll("ä", "�" );
output = output.replaceAll("å", "�" );
output = output.replaceAll("æ", "�" );
output = output.replaceAll("ç", "�" );
output = output.replaceAll("è", "�" );
output = output.replaceAll("é", "�" );
output = output.replaceAll("ê", "�" );
output = output.replaceAll("ë", "�" );
output = output.replaceAll("ì", "�" );
output = output.replaceAll("í", "�" );
output = output.replaceAll("î", "�" );
output = output.replaceAll("ï", "�" );
output = output.replaceAll("ð", "�" );
output = output.replaceAll("ñ", "�" );
output = output.replaceAll("ò", "�" );
output = output.replaceAll("ó", "�" );
output = output.replaceAll("ô", "�" );
output = output.replaceAll("õ", "�" );
output = output.replaceAll("ö", "�" );
output = output.replaceAll("÷", "�" );
output = output.replaceAll("ø", "�" );
output = output.replaceAll("ù", "�" );
output = output.replaceAll("ú", "�" );
output = output.replaceAll("û", "�" );
output = output.replaceAll("ü", "�" );
output = output.replaceAll("ý", "�" );
output = output.replaceAll("þ", "�" );
output = output.replaceAll("ÿ", "�" );
return output;
}
}