Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

  vs Α displaying in browser and source

I would like Α to display as A in the browser, but remain Α in my source code. My reason is that I would like to store the code in a SQL table as Α. However, anytime I add the literal Α and view the source code, I see A. Since this text might be resent back to the database (as input in a form), I lose the Α version.

I don't seem to have this problem with the   which is the behavior I'm looking for.

Any suggestions?

like image 596
madcolor Avatar asked Jul 15 '15 23:07

madcolor


2 Answers

Α stays the same when viewing the source code in a separate browser window. I inserted Α into my own MySQL table called 'test' using the command below, and it remains the same.

INSERT INTO test (column1, column2) VALUES ('Α', ' ');

Perhaps you were using an element inspector to view the source code? That is when Α will appear as A. This happens to other special character codes such as © (©) and ► (►).

If this is the case, then consider right clicking and selecting View Page Source or similar option instead.

like image 198
Jon Kantner Avatar answered Oct 01 '22 08:10

Jon Kantner


You need to encode and decode your Html while storing to the database. Here is a Few links to help you.

http://www.strictly-software.com/htmlencode

https://msdn.microsoft.com/en-us/library/windows/apps/hh464984.aspx

like image 30
pool pro Avatar answered Oct 01 '22 08:10

pool pro