PHP

Poor man's telnet program

Submitted by Kamal Wickramanayake on July 9, 2010 - 12:13

About 10 years ago I wanted to write a telnet client in PHP. My need was to login, execute some commands and logout. I was lazy to read the telnet protocol details. Hence I used the following approach to do it which worked for my purpose. Let your programming language be Java, C, C++, PHP, C# or anything else. It needs to have a TCP socket creation facility (TCP networking).

Here are the steps:

Convert MySQL tables and data from latin1 to utf8

Submitted by Kamal Wickramanayake on September 12, 2009 - 17:14

Context: MySQL tables maintain textual data in latin1 character encoding unless the default settings are overridden at the server, database, table or column level. Still it is possible that text in utf8 goes into these latin1 tables (for example via a web form submission). For some reason you want to change the character set from latin1 to utf8.