R: How can I get correctly special characters from MySQL?












0















I'm newbie in R and I'm creating an statistics graphics with ggplot2. Everything is OK but I have found that some characters are not printing correctly like ÁÉÍÓÚ or Ç or Ñ or Ü.



When I get the data from MySQL I get incorrect characters. Like you can see in the next image. In this image the character "Ñ" or "Ç" is replaced by



enter image description here



How can I get these special characters correctly from MySQL?



Edit I:



One screencap from my database where you can see that the special characters are saved correctly:



enter image description here










share|improve this question

























  • I assume you used utf8 encoding in the MySQL tables? Try the query SET NAMES utf8 first before you query the table information to set the connection into using utf8 encoding

    – Raymond Nijland
    Nov 15 '18 at 12:28













  • My tables are defined with CHARACTER SET 'latin1' and COLLATE 'latin1_spanish_ci'

    – José Carlos
    Nov 15 '18 at 12:33











  • latin1 does not support "special characters" like Ñ or Ç you need to use utf8

    – Raymond Nijland
    Nov 15 '18 at 12:35













  • I have updated my original post where you can see that "special characters" like Ñ or Ç are saved correctly.

    – José Carlos
    Nov 15 '18 at 12:40











  • stackoverflow.com/questions/24903814/…

    – sai saran
    Nov 15 '18 at 12:59
















0















I'm newbie in R and I'm creating an statistics graphics with ggplot2. Everything is OK but I have found that some characters are not printing correctly like ÁÉÍÓÚ or Ç or Ñ or Ü.



When I get the data from MySQL I get incorrect characters. Like you can see in the next image. In this image the character "Ñ" or "Ç" is replaced by



enter image description here



How can I get these special characters correctly from MySQL?



Edit I:



One screencap from my database where you can see that the special characters are saved correctly:



enter image description here










share|improve this question

























  • I assume you used utf8 encoding in the MySQL tables? Try the query SET NAMES utf8 first before you query the table information to set the connection into using utf8 encoding

    – Raymond Nijland
    Nov 15 '18 at 12:28













  • My tables are defined with CHARACTER SET 'latin1' and COLLATE 'latin1_spanish_ci'

    – José Carlos
    Nov 15 '18 at 12:33











  • latin1 does not support "special characters" like Ñ or Ç you need to use utf8

    – Raymond Nijland
    Nov 15 '18 at 12:35













  • I have updated my original post where you can see that "special characters" like Ñ or Ç are saved correctly.

    – José Carlos
    Nov 15 '18 at 12:40











  • stackoverflow.com/questions/24903814/…

    – sai saran
    Nov 15 '18 at 12:59














0












0








0








I'm newbie in R and I'm creating an statistics graphics with ggplot2. Everything is OK but I have found that some characters are not printing correctly like ÁÉÍÓÚ or Ç or Ñ or Ü.



When I get the data from MySQL I get incorrect characters. Like you can see in the next image. In this image the character "Ñ" or "Ç" is replaced by



enter image description here



How can I get these special characters correctly from MySQL?



Edit I:



One screencap from my database where you can see that the special characters are saved correctly:



enter image description here










share|improve this question
















I'm newbie in R and I'm creating an statistics graphics with ggplot2. Everything is OK but I have found that some characters are not printing correctly like ÁÉÍÓÚ or Ç or Ñ or Ü.



When I get the data from MySQL I get incorrect characters. Like you can see in the next image. In this image the character "Ñ" or "Ç" is replaced by



enter image description here



How can I get these special characters correctly from MySQL?



Edit I:



One screencap from my database where you can see that the special characters are saved correctly:



enter image description here







mysql r ggplot2 special-characters






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 15 '18 at 12:39







José Carlos

















asked Nov 15 '18 at 12:22









José CarlosJosé Carlos

71021949




71021949













  • I assume you used utf8 encoding in the MySQL tables? Try the query SET NAMES utf8 first before you query the table information to set the connection into using utf8 encoding

    – Raymond Nijland
    Nov 15 '18 at 12:28













  • My tables are defined with CHARACTER SET 'latin1' and COLLATE 'latin1_spanish_ci'

    – José Carlos
    Nov 15 '18 at 12:33











  • latin1 does not support "special characters" like Ñ or Ç you need to use utf8

    – Raymond Nijland
    Nov 15 '18 at 12:35













  • I have updated my original post where you can see that "special characters" like Ñ or Ç are saved correctly.

    – José Carlos
    Nov 15 '18 at 12:40











  • stackoverflow.com/questions/24903814/…

    – sai saran
    Nov 15 '18 at 12:59



















  • I assume you used utf8 encoding in the MySQL tables? Try the query SET NAMES utf8 first before you query the table information to set the connection into using utf8 encoding

    – Raymond Nijland
    Nov 15 '18 at 12:28













  • My tables are defined with CHARACTER SET 'latin1' and COLLATE 'latin1_spanish_ci'

    – José Carlos
    Nov 15 '18 at 12:33











  • latin1 does not support "special characters" like Ñ or Ç you need to use utf8

    – Raymond Nijland
    Nov 15 '18 at 12:35













  • I have updated my original post where you can see that "special characters" like Ñ or Ç are saved correctly.

    – José Carlos
    Nov 15 '18 at 12:40











  • stackoverflow.com/questions/24903814/…

    – sai saran
    Nov 15 '18 at 12:59

















I assume you used utf8 encoding in the MySQL tables? Try the query SET NAMES utf8 first before you query the table information to set the connection into using utf8 encoding

– Raymond Nijland
Nov 15 '18 at 12:28







I assume you used utf8 encoding in the MySQL tables? Try the query SET NAMES utf8 first before you query the table information to set the connection into using utf8 encoding

– Raymond Nijland
Nov 15 '18 at 12:28















My tables are defined with CHARACTER SET 'latin1' and COLLATE 'latin1_spanish_ci'

– José Carlos
Nov 15 '18 at 12:33





My tables are defined with CHARACTER SET 'latin1' and COLLATE 'latin1_spanish_ci'

– José Carlos
Nov 15 '18 at 12:33













latin1 does not support "special characters" like Ñ or Ç you need to use utf8

– Raymond Nijland
Nov 15 '18 at 12:35







latin1 does not support "special characters" like Ñ or Ç you need to use utf8

– Raymond Nijland
Nov 15 '18 at 12:35















I have updated my original post where you can see that "special characters" like Ñ or Ç are saved correctly.

– José Carlos
Nov 15 '18 at 12:40





I have updated my original post where you can see that "special characters" like Ñ or Ç are saved correctly.

– José Carlos
Nov 15 '18 at 12:40













stackoverflow.com/questions/24903814/…

– sai saran
Nov 15 '18 at 12:59





stackoverflow.com/questions/24903814/…

– sai saran
Nov 15 '18 at 12:59












0






active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53319426%2fr-how-can-i-get-correctly-special-characters-from-mysql%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes
















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53319426%2fr-how-can-i-get-correctly-special-characters-from-mysql%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Florida Star v. B. J. F.

Danny Elfman

Lugert, Oklahoma