<?php
  /**************************************************************************\
  * phpGroupWare API - CharSet code convert class (en)                       *
  * (C) Copyright 2001 Yoshihiro Kamimura your@itheart.com                   *
  * ------------------------------------------------------------------------ *
  * This is not part of phpGroupWare, but is used by phpGroupWare.           * 
  * http://www.phpgroupware.org/                                             * 
  * ------------------------------------------------------------------------ *
  * This program is free software; you can redistribute it and/or modify it  *
  * under the terms of the GNU Lesser General Public License as published    *
  * by the Free Software Foundation; either version 2.1 of the License, or   *
  * any later version.                                                       *
  \**************************************************************************/

	/* $Id: class.codecv_en.inc.php,v 1.3.16.1 2004/09/27 10:08:27 kazuyan Exp $ */
	
class codecv {

	var $m_inside;
	var $m_outside;
	var $m_needconv;
	var $lang;

	function codecv() {
		$this->m_inside = strtolower(lang('charset'));
		$this->m_outside = strtolower(lang('outcharset'));
		$this->m_needconv = false;
		$this->lang = 'en';
	}

	function in2out($str) {
		return	$str;
	}

	function out2in($str) {
		return	$str;
	}

	function get_charcode($str) {
		return	$this->m_inside;
	}
	
	function jistoeuc($str_jis) {
		return $str_jis;	
	}

	function euctojis($str_euc) {
		return $str_euc;
	}

    function euctosjis($str_euc) {
    	return $str_euc;	
    }

	function sjistoeuc($str_sjis) {
		return $str_sjis;
	}

	function auto2euc($str)
	{
		return $str;
	}
	
	function utf8toeuc($str_utf8)
	{
		return utf8_decode($str_utf8);
	}
	
	function euctoutf8($str_euc)
	{
		return utf8_encode($str_euc);
	}
	
	function mb_chunk_split($str, $chunklen = 76, $end = "\r\n")
	{
		return chunk_split($str, $chunklen, $end);
	}

	function euctoimap_utf7($str_euc)
	{
		if (function_exists('imap_utf7_encode'))
			return imap_utf7_encode($str_euc);
		else
			return $str_euc;			// Not Support
	}	
	
	function utf7_imaptoeuc($str_utf7_imap)
	{
		if (function_exists('imap_utf7_decode'))
			return imap_utf7_decode($str_utf7_imap);
		else
			return $str_utf7_imap;		// Not Support
	}
	
	function substr($str, $start, $length='')
	{
		return substr($str, $start, empty($length) ? strlen($str) : $length);
	}
}
?>
