<?php header("Content-Type:text/html; charset=UTF-8");
error_reporting(E_ALL & ~E_NOTICE);
$d = $_SERVER['QUERY_STRING'];?>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no" />
<title>UTF-8编码转换工具 - 站长社站长工具</title>
<meta name="keywords" content="UTF-8编码转换工具,站长工具" />
<meta name="description" content="UTF-8编码转换工具，美化工具" />
<link type="text/css" href="css/bootstrap.min.css" rel="stylesheet" />
<link type="text/css" href="css/main.css" rel="stylesheet" />
<script type="text/javascript" src="js/jquery-2.1.1.min.js"></script>
<script type="text/javascript" src="js/bootstrap.min.js"></script>
<script type="text/javascript" src="js/main.js"></script>
<script type="text/javascript">
            function ConvUtf(obj, btn) {
                document.getElementById("result").value = obj.value.replace(/[^\u0000-\u00FF]/g,
                function($0) {
                    return escape($0).replace(/(%u)(\w{4})/gi, "&#x$2;")
                });
            }
            function ResChinese(obj, btn) {
                document.getElementById("content").value = unescape(obj.value.replace(/&#x/g, '%u').replace(/;/g, ''));
            }
            function preview() {
                var win = window.open();
                win.document.open('text/html', 'replace');
                win.document.writeln(content.value);
                win.document.close();
            }
        </script>
</head>
<body>
<?php include('topnav.php');?>

<div class="container" style="margin-top: 68px;">
<?php include("main_header.php");?>
	<div class="row" style="margin-top: 28px;">
		<div class="col-md-9">
			<div class="panel panel-tianyu">
				<header class="panel-heading">
					<span class="glyphicon glyphicon-link"></span><strong>UTF-8编码转换工具</strong>
				</header>
				<div class="panel-body">
				<div class="box1">
                    
                        <div align="center" style="padding-top:10px;">
                            <textarea id="content" name="content" style="width:800px;height:150px;border:1px solid #c5e2f2;overflow:visible;"
                            cols="20" rows="15">请将您要转换的汉文内容粘贴在这里
                            </textarea>
                        </div>
                        <div style="margin-left:2px;padding:2px 0px 0px 0px;">
                            <input class="but2" id="conv" type="button" style="width:150px;" value="中文 转换 UTF-8 ↓"
                            onclick="ConvUtf(content,this);" />
                            <input class="but2" id="res" type="button" style="width:150px;" value="UTF-8 还原 中文 ↑"
                            onclick="ResChinese(result,this);" />
                        </div>
                        <div align="center">
                            <textarea id="result" name="result" style="width:800px;height:150px;border:1px solid #c5e2f2;overflow:visible;"
                            rows="15">
                            </textarea>
                        </div>
                        <div style="margin-left:2px;padding:2px 0px 0px 0px;">
                            <input class="but2" id="pre" type="button" value="预览转换代码" onclick="preview();"
                            />
                        </div>
                    
                </div>
				
				
					
				</div>
			</div>
		</div>
		<div class="col-md-3">
			<div class="panel panel-tianyu">
				<header class="panel-heading">
					<span class="glyphicon glyphicon-wrench"></span>工具介绍
				</header>
				<div class="panel-body">
						<p>UTF-8编码转换工具</p>
				</div>
			</div>
		</div>
		<div class="col-md-3">
			<div class="panel panel-tianyu">
				<header class="panel-heading">
					<span class="glyphicon glyphicon-save"></span>下载源码
				</header>
				<div class="panel-body">
						<p>本工具源码提供下载</p>
						<a href="http://www.zzs1.com/code/" class="btn btn-tianyu" target="_blank"><span class="glyphicon glyphicon-save">下载地址</a>
				</div>
			</div>
		</div>
	</div>
</div>
<?php include('footer.php');?>
<script type="text/javascript" src="http://v3.jiathis.com/code/jia.js?uid=1361866808579755" charset="utf-8"></script>
</body>
</html>