Special Characters Problem

Asked
Active3 hr before
Viewed126 times

5 Answers

charactersspecialproblem
90%

Stack Overflow for Teams Where developers & technologists share private knowledge with coworkers ,Can you check and see if the server is sending a charset in the Content-type header? The encoding specified in that will take precedence over what you specify with the meta element. , Stack Overflow help chat , If the font in use doesn't have the character in it the browser uses that character as a placeholder. What font are you using? – isherwood Aug 27 '15 at 15:58

1 - Replace your

<meta charset="utf-8">

with

<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

3 - Check if your browser is compatible with your font, if you're somehow importing a font. Or try and add a css to set your fonts to a default/generally accepted one like

body {
   font - family: "Times New Roman", Times, serif;
}
load more v
88%

You can use utf8_encode function which will convert your special characters to utf8 encoding data and then save it in your database and again use utf8_decode function to get special data back.,One reason – your database table / column collation is not correct like not UTF-8 or others those one support special chars.,Or just change your table or column collation type,Special characters are important to our web. We used them in different ways but If our webpage is not supporting Special characters or showing ???? instead of ‘ ‎中國哲學書電子化計劃 ‘ or ‘ בְּרֵאשִׁ֖ית בָּרָ֣א אֱלֹהִ֑ים אֵ֥ת הַשָּׁמַ֖יִם ‘ then it’s mean our controller / database is not properly working with these type of texts.

Or just change your table or column collation type

$special_char = '中國哲學書電子化計劃';

// just use this 
$special_char = utf8_encode($special_char);

// then insert it into db (use your query type)
mysql_query("INSERT INTO `TABLE_NAME` SET special_char = '".$special_char.
   "'");

// Opencart
$this - > db - > query("INSERT INTO `".DB_PREFIX.
   "TABLE_NAME` SET special_char = '".$special_char.
   "'");

// And when you fetch data then just use opposite of utf8_encode
// like your result in $special_char_result
$special_char_result = utf8_decode($special_char_result);

// this variable will display special char. text not  ????

// or another simple solution for this situation is just change the collation type of table or that particular column
// just run this query
mysql_query("alter table `TABLE_NAME` convert to character set utf8 collate utf8_unicode_ci");

// Opencart
$this - > db - > query("alter table `".DB_PREFIX.
   "TABLE_NAME` convert to character set utf8 collate utf8_unicode_ci");

// From now on just add any special chars in db and retrieve without '????' fear.
72%

The Role of Special Characters , Special Characters You Can’t Type , When you type these characters directly into your HTML code — unless you are using them as elements in the code — type in the encoding for them, so they appear correctly in the readable text: , Non-English Characters

65%

htmlspecialchars — Convert special characters to HTML entities,htmlspecialchars_decode() - Convert special HTML entities back to characters,htmlentities() - Convert all applicable characters to HTML entities, htmlspecialchars

load more v
75%

The replacement character � (often displayed as a black rhombus with a white question mark) is a symbol found in the Unicode standard at code point U+FFFD in the Specials table. It is used to indicate problems when a system is unable to render a stream of data to a correct symbol.[4] It is usually seen when the data is invalid and does not match any character: ,At one time the replacement character was often used when there was no glyph available in a font for that character. However most modern text rendering systems instead use a font's .notdef character, which in most cases is an empty box (or "?" or "X" in a box[5]), sometimes called a "tofu" (this browser displays 􏿾). There is no Unicode code point for this symbol. ,The following Unicode-related documents record the purpose and process of defining specific characters in the Specials block: ,^ Proposed code points and characters names may differ from final code points and names

The replacement character � (often displayed as a black rhombus with a white question mark) is a symbol found in the Unicode standard at code point U+FFFD in the Specials table. It is used to indicate problems when a system is unable to render a stream of data to a correct symbol.[4] It is usually seen when the data is invalid and does not match any character:

Consider a text file containing the German word für (meaning 'for') in the ISO-8859-1 encoding (0x66 0xFC 0x72). This file is now opened with a text editor that assumes the input is UTF-8. The first and last byte are valid UTF-8 encodings of ASCII, but the middle byte (0xFC) is not a valid byte in UTF-8. Therefore, a text editor could replace this byte with the replacement character symbol to produce a valid string of Unicode code points. The whole string now displays like this: "f�r".

0x66 0xFC 0x72

The replacement character � (often displayed as a black rhombus with a white question mark) is a symbol found in the Unicode standard at code point U+FFFD in the Specials table. It is used to indicate problems when a system is unable to render a stream of data to a correct symbol.[4] It is usually seen when the data is invalid and does not match any character:

Consider a text file containing the German word für (meaning 'for') in the ISO-8859-1 encoding (0x66 0xFC 0x72). This file is now opened with a text editor that assumes the input is UTF-8. The first and last byte are valid UTF-8 encodings of ASCII, but the middle byte (0xFC) is not a valid byte in UTF-8. Therefore, a text editor could replace this byte with the replacement character symbol to produce a valid string of Unicode code points. The whole string now displays like this: "f�r".

0xFC
load more v

Other "characters-special" queries related to "Special Characters Problem"