Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

php remove/identify this symbol �

Tags:

php

encoding

EDIT:

Ok I have some data (A ton of data) being pulled from a MySQL DB Table, nothing special about how the data is entered. When parsing the data and re-displaying it to Firefox this symbol � shows up. When I compare it to the DB entry it looks like a space (Nothing special). I'm using all the default PHP/MySQL settings.

Doing a var_dump or print_r is no help either.

Any thoughts?

The Symbol: �

UPDATE:

Ok I did find the character that is causing the problem

Not to be confused with

-

(The Hyphen).

like image 451
Phill Pafford Avatar asked Dec 06 '22 03:12

Phill Pafford


1 Answers

The character is the REPLACEMENT CHARACTER (U+FFFD). It is used when there was an error within an UTF code:

FFFD � REPLACEMENT CHARACTER

  • used to replace an incoming character whose value is unknown or unrepresentable in Unicode

In most cases it means that some data is interpreted with an UTF encoding while the data is not encoded with that encoding but a different one.

like image 160
Gumbo Avatar answered Dec 07 '22 18:12

Gumbo