RaiyaRaj

Earning and growing its all about knowledge

Links for 2008-09-09 10 September 2008

Filed under: Links — RaiyaRaj @ 12:30 am
 

First experience with Google Chrome : Review 4 September 2008

Filed under: Google — RaiyaRaj @ 3:06 pm
Tags: , ,

I came to know about Google Chrome. Then I checked its comic book. Comic book has convinced to download & try it.

It took few seconds to download & install it. It don’t ask much question to install it. Even it has not asked to set it as default browser. I liked it. It don’t want to create its monopoly from day one.

Title-bar

Chrome is very sleek browser. It has utilized title bar area of window as a tab bar. I see first application which has used title-bar area to other than tab. I don’t know how much people like it but I like it. Chrome has broke very old concept of any application window by replacing tab bar with title-bar. I have seen first good implementation of tab bar in Opera browser (may be in version 5 or 6). Firefox made concept of tab browsing very popular. Now it is adopted by most of all popular browser. Now Chrome has try to tab-bar with new idea. Actually it has tried to utilized space used by title bar & tried to give more area for web page.In  Chrome opening new window & tab is faster & smooth.

Address-bar

Address-bar is good. It suggest good option automatically from history & from search engine (may be i am 100% right about it). It has no separate search bar like Firefox but address-bar will be used to search. It also has option for changing search engine. Chrome highlights domain part of URL. It is a good usability feature. It is available in firefox with some add-on.

Application Shortcut

Another good feature is application shortcut. You can type Gmail URL & select from menu to make it application shortcut. It is good you don see address bar as you don’t need it while accessing such application. But this application opens in separate window. That I don’t like. It should have open in main window without address-bar & it should have saved space in task bar. Same feature is also available with Firefox using Prism.

Crash Management/ Error Handing

Chrome crashes many time during my first few hours of use. But this crash was different from Firefox & IE. I have not lost anything. It just show message of special page saying just reload the page & reload made me happy as I got everything. It also crashed while installing Silverlite from top page of Microsoft. It Also crashed while closing one tab (I don’t remember exact details about it). It has at least crashed 8-10 times while writing this blog. But it is different experience. I simply call it error while rendering page or doing some other operation like installing something. I hate frequent crashing of Chrome but I would give full marks for error handling or crash management. But I feel that error shown by Chrome is bit higher. I hope update of chrome will be make Chrome more stable in few weeks. Till the time I would not like to write WordPress blog using Chrome.

Developer Option

Chrome shows HTML source in separate tab with color highlight. It also have javascript debug feature & javascript console. Javascript console is like firebug in Firefox. I liked it very much. Not because it has features but Chrome team understand the need of developer better at first go.

Javascript Console

Javascript Console

incognito window

Chrome has good & new safety feature called incognito window. This window will keep application/page running this window hidden from other window or tab. It also don’t record it in history. Good feature.

incognito

incognito window

Status bar, Find bar, Task manager, bookmark bar

Nice find bar shown when Ctrl + f pressed. Inteligent status-bar is shown only when you on hyperlink. Progress-bar is missing. Task manager is good concept. It can help to terminate some unwanted or hanged tab or window process. Shows some important information about loaded page. Bookmark bar can show or hide  by just pressing Ctrl + b.

Usability feature: Text Zoom

Text zoom is old feature. Using this only text of page are zoomed. Other than text is not zoomed. So page get lost its actual layout. This feature is in Firefox 2 & IE 6. But IE 7 & Firefox 3 has moved to some advance zoom feature in that all content of page is zoomed including images & content like flash also.  It is something like starching base canvas on that page is drawn.

Missing features

User interface customization is first missing feature in chrome. Nowadays user like to see layout browser as it comes out of box. Everyone wants personalized layout. So feature like themes can make make me happy. Also Layout customization is require to set particular user interface component like button address bar at personalized place. Such features is available with major competitor.

Second missing is add-ons or extension. Add-ons or extension is a way to extend the custom functionality which is not a standard. As lots of add-ons are available for firefox. This add-ons of Firefox made me the real fan of Firefox. This are must features for any extensive browser user.

Final verdict

May be google has planed to introduce missing features gradully in near future. Hope we will see it soon. But I would like to see first more stable version of Chrome. Overall first preview has put good impresion on me. I would like to try feature realease of Chrome before throwning away.

Some other good review links:

  1. http://jeremybuff.wordpress.com/2008/09/03/review-google-chrome-2/
  2. http://ostatic.com/172340-blog/hands-on-with-chrome-clean-and-crisp-but-needs-extensions
  3. http://www.usefulconcept.com/index.cfm/2008/9/2/Google-Chrome-Review
  4. http://ptech.allthingsd.com/20080902/first-test-of-googles-new-browser/
 

Google Chrome: New page in browser war 2 September 2008

Filed under: Google — RaiyaRaj @ 6:56 pm
Tags: ,
Google Chrome 

 

Google Chrome

Google has launched new web browser Chrome. It is based on Webkit engine. Webkit is mainly a used by mobile phone/device browser.

Google claims that it has been tested with billions of already crawled pages by Google. So it seems it has passed good amount of automated testing.

Google has published introduction of browser in comic format on following URL. It is interesting.
http://www.google.com/googlebooks/chrome/

Here big question is: Can Chrome capture the big market share of Internet Explorer? Firefox tried to do it with many good features, but I believe majority of traffic of most site comes from Internet Explore. I think you will not find much literature about Internet Explorer beating Firefox, but you can find reverse easily.

So now it is not only about features but also about marketing, Strong Goggle is behind Chrome. We need to see how Google do the marketing of Chrome. Will it capture the market share of Internet Explorer or Firefox. Similar things happed in operating system market. People says Linux has captured the market of Unix or its proprietary variant not the market share of Microsoft Windows.

Google Chrome

Google Chrome

Firefox comes with tab browsing concept.

Chrome will come with multi process & multi threading concept.

Internet Explorer do not come with any concept, but it comes with Windows.

 

iPhone 3G Limitations 2 September 2008

Filed under: Mobile — RaiyaRaj @ 6:02 pm
Tags: ,

ARE YOU planning for iPhone… THINK TWICE BEFORE MAKING A DECISION… The short comings of iPhone are endless…

iPhone 3G

iPhone 3G

  1. No video calling,
  2. No AD2P on the Bluetooth,
  3. CAN’T share ANY (mp3, images,videos….) files via bluetooth,
  4. Can’t use as a wireless modem, (you pay ridiculous data charges to activate internet on your phone, but cannot connect it to your PC and browse when you are at home)
  5. No copy and paste,(cannot copy a part of a…. say…. email & send it….have to type it out yourself)
  6. No 3.2 or 5 megapixel camera,(the 2MP camera it carries is worst camera i’ve ever seen….. photos look like they have come out of a VGA camera)
  7. No video recording with camera,
  8. No front camera,
  9. No camera flash.
  10. No JAVA support
  11. No physical keyboard (BELIEVE me! this alone is a dealbreaker…touch keyboard as good as it looks…once you use it then only you come to know about the importance of having a hard keypad)
  12. No 3G network yet in India ..so why pay for expensive 3G phone if you cant use its 3G services … so, for India , iPhone 2.0 is no better than its first version
  13. No removable battery. (You cannot change battery. Have to send it to apple outlet.. Come on now!!!!…This is not an iPod. Its a bloody phone. You cannot live without phone for 2-3 days)
  14. No haptic feedback and
  15. Cannot send MMS,
  16. Can’t use as external storage device (16 GB of utter waste..next time you go to your friend’s house & find some interesting songs, movies, etc…sorry you cannot connect your ‘16 GB’ phone and share it!!!! Apple apparently has a solution.. ” BUY MUSIC & MOVIES FROM iTUNES STORE “….. Give me a break will you APPLE!!!)
  17. Fo FM radio,
  18. Can’t use your mp3 files as ringtones,(This is heights man!!!)
  19. Cannot insert any other SIM card
  20. Completely tied to iTunes… Connect to your friend’s iTunes & you risk erasing everything on your phone.

List goes on & on & on

We are used to these features. Most of our phones already have these features. & we cannot do with out them. I mean can you imagine paying so much for a phone with which you cannot transfer files via bluetooth. What age is this …STONE AGE???

Some features may be activated by jailbreak.. But why the hell should you risk losing your warranty after paying so much.

And want to add third party softwares??.. YOU HAVE TO BUY THEM FROM iTUNES STORE ONLY!!! . (Shell out more money). Apple is a bloody control freak. Dont surrender your freedom to it.

Its good for highend market like US (who have no idea what mobile freedom/choice is), which is in stone age compared to asian/european markets. When they want to buy a phone, they have to go to network operators and buy only those phones that are available on that network & stick to that company till their contract expires. You want to change carriers? Not before paying damages, & buying another phone on the other network again.

On the contrary, We have so much freedom. We go to handset shops & buy which ever phone we like. Then go to carriers.. checkout the plans & buy SIM.. Dont like the plan or rival carrier came up with a better plan???? EASY .. just remove & replace the SIM.

Apple are trying to IMPOSE THEIR MODEL ON US riding on the hype iPhone has created in the US (yes it was a flop in Europe …thats why Apple never talks about its sales in Europe).

Let me clear one thing though.. iphone is the best looking phone (its touch interface is nothing like you have ever seen ), & best browsing experience out there no doubt ….. (& others are fast catching up..check out the android demo at Google IO 2008)….
BUT AFTER A FEW DAYS IT ALL COMES DOWN TO FUNCTIONALITY…

WAIT FOR HTC DREAM!! (powered by android). Still not convinced by then…by all means go for iPhone…

 

3G Services on Indian Mobile 21 August 2008

Filed under: Mobile — RaiyaRaj @ 3:22 pm
Tags: , ,

Today Indian Mobile phone subscriber has access to internet via GPRS or similar service from operator. Government has set platform for 3G services. Within one year 3G services will be started in India. (BSNL plans to lunch it by December 2008). Meaning of 3G services for not technical user is simply high speed internet & video services on mobile.

3G Services Hurdle

I think 3G services in India will be available to all but only high-end user will use it like blackberry user. It will not be popular to in common man at least in first 2 years. There are few reasons that I think is following.

  1. Less popular GPRS or internet on mobile.
  2. Less localized application & content.
  3. Higher cost of services.

I think this is the time for government & companies to promote internet on mobile otherwise it will be late & may affect popularity & acceptance of 3G services.

(more…)

 

Zend Framework Bootstrap 8 August 2008

Filed under: PHP, Zend Framework — RaiyaRaj @ 5:16 pm
Tags: ,

Bootstrap is a setup process of different framework component to make easily accessible/available in application. It is very important to setup all require component of framework, so whenever it can be used effectively without any hassle. Bootstrap file is very important file for project using Zend Framework. Bootstrap file or bootstrap process is not a standard in Zend Framework, but to create bootstrap file but it is good practice. Many people use it many way.

It is important to know what are the component of Zend Framework is require. Following is good example of bootstrap.php


require_once 'Zend/Loader.php';

class Bootstrap
{

    public static $frontController = null;

    public static $root = '';

    public static $registry = null;

    //Primary function will be called first from index.php, it will call rest of functions to boot
	public static function run()
    {
        self::prepare();
        $response = self::$frontController->dispatch();
        self::sendResponse($response);
    }

    /*It is used to prepare from macro view.
	It gives macro view idea about preparation.
	Sequence of each call is important.
	*/
	public static function prepare()
    {
        self::setupPath();
    	self::setupErrorReporting();

		//To load all classes automatically, without include or require statement
        Zend_Loader::registerAutoload();

        self::setupRegistry();
        self::setupConfiguration();
        self::setupFrontController();
        self::setupView();
		self::setupLogger();
        self::setupDatabase();
		self::setupSession();
    }

    //Error reporting setting
	public static function setupErrorReporting()
    {
    	error_reporting(E_ALL|E_STRICT);
    	ini_set('display_errors', true);
    }

    //Path settings will be done using this
	public static function setupPath()
    {
        $root = dirname(dirname(__FILE__));
		set_include_path(
		    $root . '/library' . PATH_SEPARATOR .
			$root . '/application' . PATH_SEPARATOR .
			$root . '/application/models' . PATH_SEPARATOR .
			 get_include_path()
		);
        self::$root = dirname(dirname(__FILE__));
    }

	//Date time setting will be done here
	public static function setupDateTime()
	{
		date_default_timezone_set('Europe/London');
	}

    //Registry setting will be done here.
	public static function setupRegistry()
    {
        self::$registry = new Zend_Registry(array(), ArrayObject::ARRAY_AS_PROPS);
        Zend_Registry::setInstance(self::$registry);
    }

    //Configuration file reading & setting up configuration will be done using following.
	public static function setupConfiguration()
    {
        $config = new Zend_Config_Ini(
            self::$root . '/application/config/config.ini',
            'general'
        );
        self::$registry->configuration = $config;
    }

    //Important: Setting of front controller will done here.
	public static function setupFrontController()
    {
        self::$frontController = Zend_Controller_Front::getInstance();
        self::$frontController->throwExceptions(true);
        self::$frontController->returnResponse(true);
        self::$frontController->setControllerDirectory(
            array(
                'default' => self::$root . '/application/controllers',
				'admin' => self::$root . '/application/admin/controllers'
            )
        );
        self::$frontController->setParam('registry', self::$registry);
    }

    /*View setup will be done here.
	Setup view encoding, layout setup also done here
	*/
	public static function setupView()
    {
        $view = new Zend_View;
        $view->setEncoding('UTF-8');
        $viewRenderer = new Zend_Controller_Action_Helper_ViewRenderer($view);
        Zend_Controller_Action_HelperBroker::addHelper($viewRenderer);
        Zend_Layout::startMvc(
            array(
                'layoutPath' => self::$root . '/application/views/layouts',
                'layout' => 'common',
                'pluginClass' => 'ZFBlog_Layout_Controller_Plugin_Layout'
            )
        );
    }

    /*DB setup done here.
	Read configuration, create db instance & set in registry to use in other part of application.*/
	public static function setupDatabase()
    {
        $config = self::$registry->configuration;
        $db = Zend_Db::factory($config->db->adapter, $config->db->toArray());
        $db->query("SET NAMES 'utf8'");
        self::$registry->database = $db;
        Zend_Db_Table::setDefaultAdapter($db);
    }

    //Response will be sent from following function, also set header for response.
	public static function sendResponse(Zend_Controller_Response_Http $response)
    {
        $response->setHeader('Content-Type', 'text/html; charset=UTF-8', true);
    	$response->sendResponse();
    }

	//Logger setup will can be done using following
	public static function setupLogger()
	{
		/**
		* Create a log formatter
		*/
		$format = '%timestamp% %priorityName% (%priority%): %message%' . PHP_EOL;
		$formatter = new Zend_Log_Formatter_Simple($format);

		/**
		* Create a file logger
		*/
		$stream = @fopen(APP_DIR . "tmp/logs/" . date("Y-m-d") . ".php", 'a', false);
		if (!$stream)
		{
			throw new Exception('Failed to open stream');
		}
		try
		{
			$fileWriter = new Zend_Log_Writer_Stream($stream);
			$fileWriter->setFormatter($formatter);
			$fileLogger = new Zend_Log($fileWriter);
			Zend_Registry::set("fileLogger", $fileLogger);
		}
		catch (Zend_Log_Exception $e)
		{
			echo "Error: " . $e->getMessage();
		}
		catch (Zend_Exception $e)
		{
			echo "Error: " . $e->getMessage();
		}
	}

	/*
	Zend session setting done here.
	*/
	public static function setupSession()
	{
		try
		{
			Zend_Session::setOptions(array(
				'save_path' => APP_DIR . "/tmp/sessions",
				'remember_me_seconds' => 7200,
		));
		Zend_Session::start();
		}
		catch (Zend_Session_Exception $e)
		{
			$dbLogger->log('Error: ' . $e->getMessage(), 1);
			$fileLogger->log($e->getMessage(), 1);
		}
		$defaultNs = new Zend_Session_Namespace('default');

		Zend_Registry::set("defaultNs", $defaultNs);

		if($config->log_level == 2)
		{
			$fileLogger->info("Sessions setup finished!");
		}
	}

}

To run this bootstrap file we just need to add following code to index.php

require '../application/Bootstrap.php';
Bootstrap::run();

There are many Zend Framework component that is used in normal/regular/usual project but I have not placed it in above code listing. Please suggest.

Please feel free to provide your feedback.

 

Master Piece of Imagination : Nokia 6639 Mobile Phone + Computer + DSLR Camera 4 August 2008

Filed under: Mobile — RaiyaRaj @ 2:18 pm
Tags: , ,

One morning I have received one email from my friend with subject “Nokia 6639 Cell Phone + Computer + Camera”. In the description he wrote “Master piece from nokia don’t miss it”. He has also given pictures with detail specification about it. At first look liked it very much. To get about some more detail I tried search on google. I found that information for this product is not available on nokia site. Then I given attention to detail specification about it. It was as following: Pictures are at the end of the post.

NOKIA 6639 Specification

Frequency: GSM/GPRS/EDGE network, CDMA, WCDMA, TD-SCDMA, CDMA2000.
Israel set arbitrary color options :
Size
: 109 48 quenching
Weight
: 100 grams
Battery
: Lithium Ion Battery BM12P, Convergence 9800
Standby time
: 100 hours
16 million color TFT color screen parameters
: ;1024 768 pixels, 3.2 inches;
* For the system
: Symbian 12.0 v16.6z simplified Chinese version
Processor
: Pentium M-Dothan binuclear 2.0GHMz
Memory
: Dual Channel DDR2 512M, the biggest can be expanded to 2GB
Display
: nVIDIA Geforce Go 7800GT
WAP support fly along
:
Nowhere 256 Chord
:
Embedded speakers
: 7.1-channel surround sound output
Photo identification of the caller calls Animation
:
160 GB internal hard disk
:
Support memory expansion
: Mixed-CF, Microdrive miniature hard disk compatibility, RS-MMC, miniSD , maximum support 160 GB
Adapter Type
: USB2.0/IEEE1394
: Support WAV music format, MP3, conjecture, Ogg Vorbis, RAW, VOX, CCIUT u-Law, PCM, MPC (MPEG plus/MusePack), MP2 (MPEG 1 Layer 2), ADPCM, CCUIT A-LAW, AIFC, DSP, GSM, CCUIT G721, CCUIT G723, G726 format CCUIT
Video Format
: All support
20 EQ sound effects sound effect modes : Mode
: DAB radios can receive digital broadcasting / FM stereo radio broadcasting group memory ;DAB/FM 50;
: 12.8 million effective pixel sensor, the APS size CCD, with Fangdou, ultrasonic dust removal function.
Scene
: the main revolutionary cell phone cards mouth open, compatible CNMOP lens LEICA Lycra AF24-180mm/F2.8 receptors produced in Germany in support of a full-time manual focusing.
Deputy
: German production Zeiss lens coating 50mm/F1.0 nematic Chase.
Autofocus mode
: 11/7 zone TTL focusing, AF-1 to +19EV working environment :
Shutter speed
: electromagnetic control longitudinal curtain shutter doors B, 30-1/10000 seconds
Lianpai
: 12 / sec, which can be taken 90 or 50 RAW format photos in JPEG format photographs
Photometry
: 3D matrix photometric II, the central focus point photometric and photometric (3mm yen, about 2% of the area)
Exposure modes : automatic, procedural exposure aperture priority, shutter priority, manual, users set up
Photo
: RAW format, JPEG
Exposure compensation
: +5EV half class, third-class or 1.0 grade
Sensitivity range
: ISO 50-3200 (third stall incremental), and 6400 can be expanded to 25
White Balance
: Automatic, Manual, pre –
White balance preset
: flash and shadow, overcast sky, sunlight, fluorescent lamps and incandescent lamps
Embedded camera flash
:
Effective flash range
: 20 m
Flash modes
: 1005-pixel RGB TTL flash control sensor ;i-TTL balance filled with flash flash flash or standard i-TTL
Video
: audio video film shooting, 720 480-definition DVD RMVB compression, support for real-time optical zoom.
Video broadcast : Windows Media Player, H.263 /MPEG4, WITH AMR-NB, AMR-NB audio decoders, decoder
Other additional functions
:
First, Swiss Plug procedures remotely Train (with the public wireless transmission protocol), sparking Zippo;
Second, the LED beam, severe chemical devices, thermometer, filter and needle guide function for wild camping.
Third, the exclusive beer and bottled champagne opening device adapter, the adapter can be connected to a dedicated electric razor (compatible with Brown shaving support);
Fourth, Micro Electric Drier (external hard drives need 12V power supply)
5, welcoming everyone to keep abreast added

Then I realized it is a fake product. I concluded to this decision based on following.

  1. Symbian has not released version 12. Latest version of Symbian OS is 9.5.
  2. No manufacturer has produce small/tiny parts (HDD, RAM, Processor, Graphics card etc…) that can feet in mobile as specified. You can check the minimum size of component used in this device with respective leading component manufacturer like intel, nVIDIA etc…
  3. Other point come in my mind if nokia is going to build such device why they think to assemble all parts from leading manufacturer. Nokia has expertise to build such device based on own capability or own hardware component. If they build why they they advertise like it.

I think above points are enough to believe its not a real product. If we try we can find more points to prove it as a fake product. Few days back I was reading about next generation devices & I found about Mobile Internet Device (Intel). These devices are in between mobile phone & laptop. These are the device with screen size around 6-8 inch. Normal laptop screen size is around 14-15 inch. Usual high-end smart phone screen around 2.4 inch to 3.5 inch.

Nowadays device manufacturer companies are thinking to build mobile Internet device (MID). There is confusion about standard of hardware/architecture for such type of devices. Computer is based on standard of IBM PC or 32 bit & 64 bit architecture, but in mobile phone there is no unique standard that is followed by  major or leading mobile manufacturer. May be there are some technical design problem with particular standard/architecture. Mobile & Laptop are 2 different class of device. May be MID manufacturer will try to address problem & put good feature of both type of device in next generation MID. Above specification can be good idea for new generation device.

When I seen this specification first time I tried to criticize original email sender. But now I think it is a good imagination. Many people try to call it as swiss knife as it has features of Mobile phone, Digital SLR Camera, Laptop etc… I tried to search about on internet with term “nokia 6639″, I found that many people like such device in real world. Its natural everybody wants such good gadget. Now I also think if such device available in reality then I would like to call it Master Piece till the time it is Master Piece of Imagination.







 

PHPMailer BUG : Splits the subject line in the middle of a multi-byte character 24 July 2008

Filed under: Mojibake — RaiyaRaj @ 10:38 am
Tags: , ,

PHPMailer is one of my favorite library for sending email since long. I though it is really mature library and still I believe it. Nowadays its getting more & more mature.  I was using PHPMailer v1.73.

Last week I week, I have seen major bug in my application. It makes junk char/mojibake in subject line. I use all content in utf-8. I set all settings to make email completely utf-8. Then I try to read code of my project 2-3 times but it has not problem at all. Then I moved to Google to search solution for the problem. I found following links.

#2957 ([PATCH] Long utf-8 encoded subject fails (phpmailer bug)) – symfony – Trac

Then I realized that problem is in PHPMailer library. Following is the actual problem. If a subject line contains non US ASCII characters and the encoding is set to UTF-8, phpMailer occasionally splits the subject line in the middle of a multi-byte character, causing the encoded representation to appear in the email client. Specially problem appears when email subject contains multi-byte char & length is more than 20 char. You can usually find problem around or after 20th char.

#2957: encoding.patch – symfony – Trac

The above link has also given solution to the problem. But before adopting patch,I visited the PHPMailer site ( http://phpmailer.codeworxtech.com). I found PHPMailer 2.2.1 is already released on July 20 2008. Then I downloaded the latest version & checked its code, same patch is found in latest release. So I upgraded to PHPMailer 2.2.1.

 

8 Steps To Avoid Mojibake 3 July 2008

Filed under: Mojibake — RaiyaRaj @ 9:33 am
Tags: , ,

Mojibake problem is common problem which is usually seen with many non English sites or program. Non English content needs some special treatment while processing, saving, showing or exporting. There are many mistake made during software development which creates mojibake problem. There are few precaution to take to avoid mojibake problem.

Following are steps to avoid mojibake

  1. Check encoding of program file. Many time file is not save in required encoding or corrupted. File itself contain some mojibake char. To avoid this problem use suitable editor which supports require encoding. While saving file check encoding/char set property with available program (Many editor provides “Character Code” or “Encoding” property in SAVE/SAVE AS dialog box).
  2. Verify following properties in database at different level (Server, Connection, DB, Table, Field)
    -Charset, Collation
  3. Set suitable charset or locale settings just after connecting to DB. This will solve some big problem.
    For example if you are using PHP-MySQL:

    /************** PHP Code starts *****************/
    //Connect to mysql
    mysql_connect($host, $uid, $pwd, true);
    //select database
    mysql_select_db($dbase);

    //Set connction charset
    @mysql_query(“SET CHARACTER SET $charset”);

    //Set connction charset
    mysql_query(“SET NAMES $charset;”);
    /************** PHP Code ends *******************/

  4. Set suitable character encoding in web page using meta tag. like following.
    <meta http-equiv=”Content-Type” content=”text/html; charset=utf-8″ />
  5. Set suitable charset for CSS file & Javascript.
    Put something like following in first line of CSS file
    @charset “UTF-8″;
    Define charset property in <script> tag
  6. Set suitable value for following property for email, while sending email from program.
    CharSet, Encoding, ContentType
  7. While exporting data as CSV set suitable value for following header properties.
    Content-Type, Content-Disposition, Content-Language, Content-transfer-encoding
  8. While importing/exporting/converting content between different format, always check for charset/encoding property in available program.

Some terminologies need to know while dealing with i18n or l10n.

Mojibake:

http://en.wikipedia.org/wiki/Mojibake

Character encoding:

http://en.wikipedia.org/wiki/Character_encoding

Code page:

http://en.wikipedia.org/wiki/Code_page

Windows code page:

http://en.wikipedia.org/wiki/Windows_code_page

Unicode:

http://en.wikipedia.org/wiki/Unicode

UTF-8:

http://en.wikipedia.org/wiki/UTF-8

Shift JIS:

http://en.wikipedia.org/wiki/Shift_JIS

EUC:

http://en.wikipedia.org/wiki/Extended_Unix_Coding

EUC-JP:

http://en.wikipedia.org/wiki/Extended_Unix_Coding#EUC-JP

Collation:

http://en.wikipedia.org/wiki/Collation