{"id":8400,"date":"2011-07-19T23:53:17","date_gmt":"2011-07-19T23:53:17","guid":{"rendered":"http:\/\/wpml.org\/?post_type=faq&#038;p=8400"},"modified":"2023-09-06T11:34:11","modified_gmt":"2023-09-06T11:34:11","slug":"texts-showing-as","status":"publish","type":"faq","link":"https:\/\/wpml.org\/vi\/faq\/texts-showing-as\/","title":{"rendered":"Why are my texts showing as \u2013 ???????"},"content":{"rendered":"<p class=\"lead\">Your texts are showing as ??????? because your database character encoding is different from UTF-8.<\/p>\n<p>If you&#8217;re using <strong>PHPMyAdmin<\/strong>, the structure of your <strong>wp_posts<\/strong> table should look something like this:<\/p>\n<figure id=\"attachment_8401\" aria-describedby=\"caption-attachment-8401\" style=\"width: 373px\" class=\"wp-caption aligncenter\"><img decoding=\"async\" class=\"size-full wp-image-8401 \" title=\"wp_posts_phpmyadmin\" src=\"http:\/\/wpml.org\/wp-content\/uploads\/2011\/07\/wp_posts_phpmyadmin.png\" alt=\"\" width=\"373\" height=\"370\" srcset=\"https:\/\/wpml.org\/wp-content\/uploads\/2011\/07\/wp_posts_phpmyadmin.png 373w, https:\/\/wpml.org\/wp-content\/uploads\/2011\/07\/wp_posts_phpmyadmin-150x148.png 150w, https:\/\/wpml.org\/wp-content\/uploads\/2011\/07\/wp_posts_phpmyadmin-300x297.png 300w\" sizes=\"(max-width: 373px) 100vw, 373px\" \/><figcaption id=\"caption-attachment-8401\" class=\"wp-caption-text\">wp_posts viewed from PHPMyAdmin<\/figcaption><\/figure>\n<p>If you see a different value for the <strong>collation<\/strong>, it means that the character encoding is wrong. This will cause text to display incorrectly because the browser doesn&#8217;t know how to show non-English characters.<\/p>\n<h2>How can I fix this issue?<\/h2>\n<p>First, <strong>make sure to backup your database<\/strong>.<\/p>\n<p>All you need to do is run ALTER statements which will go through your data and change it from its current encoding to UTF-8. The easiest way to do this is by using the <a href=\"https:\/\/wordpress.org\/plugins\/database-collation-fix\/\" target=\"_blank\" rel=\"noopener\">Database Collation Fix<\/a>\u00a0plugin.<\/p>\n<p>In essence, your database needs to be adjusted using the following two SQL statements:<\/p>\n<pre>ALTER TABLE $table DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci\r\nALTER TABLE $table CHANGE $field_name $field_name $field_type CHARACTER SET utf8 COLLATE utf8_bin<\/pre>\n<h2>How can I prevent this from happening again?<\/h2>\n<p>Finally, to make sure that you&#8217;re not skewing away from UTF-8 in the future, edit your <strong>wp-config.php<\/strong> file and set the charset definition correctly.<\/p>\n<p>It should say:<\/p>\n<pre>\/** Database Charset to use in creating database tables. *\/\r\ndefine('DB_CHARSET', 'utf8');\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Your texts are showing as ??????? due to a database encoding mismatch. Fix it by running the SQL ALTER statements or using the Database Collation Fix plugin.<\/p>\n","protected":false},"author":2,"featured_media":0,"menu_order":40,"template":"","meta":{"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0,"_uag_custom_page_level_css":"","ep_exclude_from_search":false,"footnotes":""},"faq-category":[26133],"class_list":["post-8400","faq","type-faq","status-publish","hentry","faq-tags-charset","faq-tags-utf8","faq-category-troubleshooting"],"spectra_custom_meta":{"_edit_last":["578773"],"_edit_lock":["1693999941:578773"],"_icl_translator_note":[""],"bbps-topic-tags":["a:0:{}"],"_views_template":["0"],"_alp_processed":["1694000052"],"_subscription_coupon_product_id":["0"],"inline_featured_image":["0"],"_wpml_word_count":["243"],"_wpv_contains_gutenberg_views":[""],"_wpml_location_migration_done":["1"],"_wpml_media_duplicate":["0"],"_wpml_media_featured":["1"],"_yoast_wpseo_content_score":["90"],"faq_order":["5"],"wpcf-faq-category":["4"],"_oembed_4ba9cd2220e447854339cd9ed2c0e9c3":["{{unknown}}"],"_oembed_8f7288ccd1228336cd0cbad12f165507":["{{unknown}}"],"_yoast_wpseo_estimated-reading-time-minutes":["2"],"_oembed_bbf56b1d4c25ce11481afba39f176f85":["<iframe title=\"Using WPML to translate content created with page builders\" width=\"700\" height=\"394\" src=\"https:\/\/www.youtube.com\/embed\/MSqNzrdPMkE?feature=oembed&enablejsapi=1&origin=https:\/\/wpml.org\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen><\/iframe>"],"_oembed_time_bbf56b1d4c25ce11481afba39f176f85":["1633598436"],"_oembed_b1f165c45b1c0061ef14102a3255a165":["<iframe title=\"WPML with Gutenberg\" width=\"700\" height=\"394\" src=\"https:\/\/www.youtube.com\/embed\/mpeEuTRYhZA?feature=oembed&enablejsapi=1&origin=https:\/\/wpml.org\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen><\/iframe>"],"_oembed_time_b1f165c45b1c0061ef14102a3255a165":["1652799203"],"_oembed_f56bf1c5a64a315a94e4cbf7a197b2b0":["<iframe title=\"Integration between Astra theme and Toolset\" width=\"700\" height=\"394\" src=\"https:\/\/www.youtube.com\/embed\/z0GrsNVmFjo?feature=oembed&enablejsapi=1&origin=https:\/\/wpml.org\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen><\/iframe>"],"_oembed_time_f56bf1c5a64a315a94e4cbf7a197b2b0":["1652799203"],"_yoast_wpseo_wordproof_timestamp":[""],"_yoast_wpseo_primary_faq-category":[""],"_uag_css_file_name":["uag-css-8400.css"]},"uagb_featured_image_src":{"full":false,"thumbnail":false,"medium":false,"medium_large":false,"large":false,"1536x1536":false,"2048x2048":false,"gform-image-choice-sm":false,"gform-image-choice-md":false,"gform-image-choice-lg":false,"woocommerce_thumbnail":false,"woocommerce_single":false,"woocommerce_gallery_thumbnail":false},"uagb_author_info":{"display_name":"Amir","author_link":"https:\/\/wpml.org\/vi\/author\/amir\/"},"uagb_comment_info":0,"uagb_excerpt":"Your texts are showing as ??????? due to a database encoding mismatch. Fix it by running the SQL ALTER statements or using the Database Collation Fix plugin.","_links":{"self":[{"href":"https:\/\/wpml.org\/vi\/wp-json\/wp\/v2\/faq\/8400","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wpml.org\/vi\/wp-json\/wp\/v2\/faq"}],"about":[{"href":"https:\/\/wpml.org\/vi\/wp-json\/wp\/v2\/types\/faq"}],"author":[{"embeddable":true,"href":"https:\/\/wpml.org\/vi\/wp-json\/wp\/v2\/users\/2"}],"version-history":[{"count":8,"href":"https:\/\/wpml.org\/vi\/wp-json\/wp\/v2\/faq\/8400\/revisions"}],"predecessor-version":[{"id":14351865,"href":"https:\/\/wpml.org\/vi\/wp-json\/wp\/v2\/faq\/8400\/revisions\/14351865"}],"wp:attachment":[{"href":"https:\/\/wpml.org\/vi\/wp-json\/wp\/v2\/media?parent=8400"}],"wp:term":[{"taxonomy":"faq-category","embeddable":true,"href":"https:\/\/wpml.org\/vi\/wp-json\/wp\/v2\/faq-category?post=8400"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}