How should I escape commas and speech marks in CSV files so they work in Excel?

We eventually found the answer to this. Excel will only respect the escaping of commas and speech marks if the column value is NOT preceded by a space. So generating the file without spaces like this… Reference,Title,Description 1,”My little title”,”My description, which may contain “”speech marks”” and commas.” 2,”My other little title”,”My other description, which … Read more

Converting Symbols, Accent Letters to English Alphabet

Reposting my post from How do I remove diacritics (accents) from a string in .NET? This method works fine in java (purely for the purpose of removing diacritical marks aka accents). It basically converts all accented characters into their deAccented counterparts followed by their combining diacritics. Now you can use a regex to strip off … Read more

How do I block or restrict special characters from input fields with jquery?

A simple example using a regular expression which you could change to allow/disallow whatever you like. $(‘input’).on(‘keypress’, function (event) { var regex = new RegExp(“^[a-zA-Z0-9]+$”); var key = String.fromCharCode(!event.charCode ? event.which : event.charCode); if (!regex.test(key)) { event.preventDefault(); return false; } });

Get Character value from KeyCode in JavaScript… then trim

In my experience String.fromCharCode(e.keyCode) is unreliable. String.fromCharCode expects unicode charcodes as an argument; e.keyCode returns javascript keycodes. Javascript keycodes and unicode charcodes are not the same thing! In particular, the numberpad keys return a different keycode from the ordinary number keys (since they are different keys) while the same keycode is returned for both upper … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)