Re: [R] Accents and special character using hwriter (on Windows)
Thanks David, but this is not easy to me as these string are already in my data (labels, variable strings). Well, I still can make some script to do it, but it's messy, maybe I want make a Word file (not a html through Word) after this. When a HTML page has a UTF-8 charset it works ok with characters such as í or ñ. It seems that it's a Windows (maybe just Win7) issue. I will try to find out a bit when I come back to work. -- View this message in context: http://r.789695.n4.nabble.com/Accents-and-special-character-using-hwriter-on-Windows-tp4638474p4639739.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Accents and special character using hwriter (on Windows)
The safest way to include special characters is to use a character code. You are at the mercy of the browser otherwise and browsers behave very differently when confronted with unusual things. You don't mention which browser you are using on Windows, which is a severe gap in the information you provided. Here is an example which has been tested on Windows using IE, Firefox, Safari and Chrome (recent versions of all, I can't be bothered checking the versions). It also renders correctly if the file is opened in Word (versions based on xml). require(hwriter) pg - openPage(specialcharacters.html) hwrite(Test Special Characters, pg, heading = 1, br = TRUE) hwrite(Ciencias Sociales y Juriacute;dicas n:74 | 33.94%, pg, br = TRUE) hwrite(Ciencias Sociales y Jur#237;dicas n:74 | 33.94%, pg, br = TRUE) closePage(pg) For other special character codes, see for example http://www.ascii.cl/htmlcodes.htm David Scott On 31/07/2012 9:21 p.m., ramonovelar wrote: Thanks Arun, Yes, I have Windows 7. I have tried 2 versions of R, 2.14.1 and 2.15.x, but it did not change anything. Right now I can't try a different version of win. Ramón On Tuesday, July 31, 2012, arun kirshna [via R] wrote: Hello, I tried your code in R 2.15 with Ubuntu 12.04. It looks okay to me. datosdv-Ciencias Sociales y JurÃdicas n:74 | 33.94% print(datosdv) #[1] Ciencias Sociales y JurÃdicas n:74 | 33.94% library(hwriter) p=openPage('test.html') hwrite(datosdv,p,br=TRUE) #test.html output Ciencias Sociales y JurÃdicas n:74 | 33.94% Probably, it must be specific with the windows. Are you using windows7? A.K. - Original Message - From: ramonovelar[hidden email]http://user/SendEmail.jtp?type=nodenode=4638501i=0 To: [hidden email]http://user/SendEmail.jtp?type=nodenode=4638501i=1 Cc: Sent: Monday, July 30, 2012 7:11 PM Subject: [R] Accents and special character using hwriter (on Windows) Hello, I have a problem with special characters such as à or ñ when using hwriter. This only happens when I use windows, it works fine on mac. If I do: print(datosdv) Ciencias Sociales y JurÃdicas n:74 | 33.94% but: hwrite(datosdv, p, br=TRUE) Ciencias Sociales y Jur�dicas n:74 | 33.94% The bad sign is in the code, is not a problem of the encoding of the html page, that is in UTF-8. Does anybody have found this? Many thanks in advance. Ramón -- View this message in context: http://r.789695.n4.nabble.com/Accents-and-special-character-using-hwriter-on-Windows-tp4638474.html Sent from the R help mailing list archive at Nabble.com. __ [hidden email]http://user/SendEmail.jtp?type=nodenode=4638501i=2mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ [hidden email]http://user/SendEmail.jtp?type=nodenode=4638501i=3mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. -- If you reply to this email, your message will be added to the discussion below: http://r.789695.n4.nabble.com/Accents-and-special-character-using-hwriter-on-Windows-tp4638474p4638501.html To unsubscribe from Accents and special character using hwriter (on Windows), click herehttp://r.789695.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_codenode=4638474code=cmFtb24ub3ZlbGFyQGdtYWlsLmNvbXw0NjM4NDc0fC0xNzk0Mjk1MDc3 . NAMLhttp://r.789695.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewerid=instant_html%21nabble%3Aemail.namlbase=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespacebreadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. -- _ David Scott Department of Statistics The University of Auckland, PB 92019 Auckland 1142,NEW ZEALAND Phone: +64 9 923 5055, or +64 9 373 7599 ext 85055 Email: d.sc...@auckland.ac.nz, Fax: +64 9 373 7018 [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained
Re: [R] Accents and special character using hwriter (on Windows)
Hello, I tried your code in R 2.15 with Ubuntu 12.04. It looks okay to me. datosdv-Ciencias Sociales y Jurídicas n:74 | 33.94% print(datosdv) #[1] Ciencias Sociales y Jurídicas n:74 | 33.94% library(hwriter) p=openPage('test.html') hwrite(datosdv,p,br=TRUE) #test.html output Ciencias Sociales y Jurídicas n:74 | 33.94% Probably, it must be specific with the windows. Are you using windows7? A.K. - Original Message - From: ramonovelar ramon.ove...@gmail.com To: r-help@r-project.org Cc: Sent: Monday, July 30, 2012 7:11 PM Subject: [R] Accents and special character using hwriter (on Windows) Hello, I have a problem with special characters such as í or ñ when using hwriter. This only happens when I use windows, it works fine on mac. If I do: print(datosdv) Ciencias Sociales y Jurídicas n:74 | 33.94% but: hwrite(datosdv, p, br=TRUE) Ciencias Sociales y Jur�dicas n:74 | 33.94% The bad sign is in the code, is not a problem of the encoding of the html page, that is in UTF-8. Does anybody have found this? Many thanks in advance. Ramón -- View this message in context: http://r.789695.n4.nabble.com/Accents-and-special-character-using-hwriter-on-Windows-tp4638474.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Accents and special character using hwriter (on Windows)
Thanks Arun, Yes, I have Windows 7. I have tried 2 versions of R, 2.14.1 and 2.15.x, but it did not change anything. Right now I can't try a different version of win. Ramón On Tuesday, July 31, 2012, arun kirshna [via R] wrote: Hello, I tried your code in R 2.15 with Ubuntu 12.04. It looks okay to me. datosdv-Ciencias Sociales y JurÃdicas n:74 | 33.94% print(datosdv) #[1] Ciencias Sociales y JurÃdicas n:74 | 33.94% library(hwriter) p=openPage('test.html') hwrite(datosdv,p,br=TRUE) #test.html output Ciencias Sociales y JurÃdicas n:74 | 33.94% Probably, it must be specific with the windows. Are you using windows7? A.K. - Original Message - From: ramonovelar [hidden email]http://user/SendEmail.jtp?type=nodenode=4638501i=0 To: [hidden email] http://user/SendEmail.jtp?type=nodenode=4638501i=1 Cc: Sent: Monday, July 30, 2012 7:11 PM Subject: [R] Accents and special character using hwriter (on Windows) Hello, I have a problem with special characters such as à or ñ when using hwriter. This only happens when I use windows, it works fine on mac. If I do: print(datosdv) Ciencias Sociales y JurÃdicas n:74 | 33.94% but: hwrite(datosdv, p, br=TRUE) Ciencias Sociales y Jur�dicas n:74 | 33.94% The bad sign is in the code, is not a problem of the encoding of the html page, that is in UTF-8. Does anybody have found this? Many thanks in advance. Ramón -- View this message in context: http://r.789695.n4.nabble.com/Accents-and-special-character-using-hwriter-on-Windows-tp4638474.html Sent from the R help mailing list archive at Nabble.com. __ [hidden email] http://user/SendEmail.jtp?type=nodenode=4638501i=2mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ [hidden email] http://user/SendEmail.jtp?type=nodenode=4638501i=3mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. -- If you reply to this email, your message will be added to the discussion below: http://r.789695.n4.nabble.com/Accents-and-special-character-using-hwriter-on-Windows-tp4638474p4638501.html To unsubscribe from Accents and special character using hwriter (on Windows), click herehttp://r.789695.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_codenode=4638474code=cmFtb24ub3ZlbGFyQGdtYWlsLmNvbXw0NjM4NDc0fC0xNzk0Mjk1MDc3 . NAMLhttp://r.789695.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewerid=instant_html%21nabble%3Aemail.namlbase=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespacebreadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml -- == Ramón Ovelar -- View this message in context: http://r.789695.n4.nabble.com/Accents-and-special-character-using-hwriter-on-Windows-tp4638474p4638515.html Sent from the R help mailing list archive at Nabble.com. [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] Accents and special character using hwriter (on Windows)
Hello, I have a problem with special characters such as í or ñ when using hwriter. This only happens when I use windows, it works fine on mac. If I do: print(datosdv) Ciencias Sociales y Jurídicas n:74 | 33.94% but: hwrite(datosdv, p, br=TRUE) Ciencias Sociales y Jur�dicas n:74 | 33.94% The bad sign is in the code, is not a problem of the encoding of the html page, that is in UTF-8. Does anybody have found this? Many thanks in advance. Ramón -- View this message in context: http://r.789695.n4.nabble.com/Accents-and-special-character-using-hwriter-on-Windows-tp4638474.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.