function writeFile_( PathFile, Content )
	{
	netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
	var ioService = Components.classes['@mozilla.org/network/io-service;1']
    	.getService(Components.interfaces.nsIIOService); 
	

	var file = Components.classes['@mozilla.org/file/local;1']
    	.createInstance(Components.interfaces.nsILocalFile);
	// only abolute path supported
	file.initWithPath( PathFile );  

	//if (!file.exists())
    //	file.create(file.NORMAL_FILE_TYPE, 0666);
	// global
	fileStream = Components
    	.classes['@mozilla.org/network/file-output-stream;1']
    	.createInstance(Components.interfaces.nsIFileOutputStream);

	// use 0x02 | 0x10 to open file for appending.  
	// write, create, truncate  
	fileStream.init(file, 0x02 | 0x08 | 0x20, 0666, 0);   

	//var charset = 'EUC-JP';
	var charset = 'UTF-8';
	var converterStream = Components
		.classes['@mozilla.org/intl/converter-output-stream;1']
		.createInstance(Components.interfaces.nsIConverterOutputStream);
	converterStream.init(fileStream, charset, Content.length,
		Components.interfaces.nsIConverterInputStream.DEFAULT_REPLACEMENT_CHARACTER);
  
	converterStream.writeString(Content);
	converterStream.close();
	fileStream.close();
}

// var Content = '<html><head><META content="text/html; charset=UTF-8" http-equiv="Content-Type"></head><body>';
// Content = Content + 'hello world:<br>\u5909\u63db\u30c6\u30b9\u30c8</body></html>';
// WriteFile_('/home/frosch/www/www.newenergyshop.com/htm.Test/xxx.htm', Content);
