<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    小剛

    在用struts等編程時,中文轉換成資源文件unicode碼時的一個小程序

    把以下代碼保存成xxx.htm文件即可。
     1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
     2
     3<html>
     4<head>
     5<STYLE><!--
     6.button {
     7    font-size: 10.5pt; 
     8    color: #FFFFFF;
     9    background-color: #F58541;
    10    border: 1px solid #BE5414;
    11    clear: both;
    12    height: 18px;
    13    width: 45px;
    14}

    15.button1 {
    16    font-size: 10.5pt; 
    17    color: #FFFFFF;
    18    background-color: #F58541;
    19    border: 1px solid #BE5414;
    20    clear: both;
    21    height: 18px;
    22    width: 135px;
    23}

    24-->
    </STYLE>
    25    <title>轉換編碼</title>
    26<script language="JavaScript" type="text/javascript" >
    27 function change(){
    28 var onestring=document.form1(0).value;
    29 if(onestring !=""){
    30            var temp=escape(onestring);
    31            var temp1=temp.replace(/\%/g,"\\")
    32            document.form1(5).value=temp1
    33 }
    else{
    34  alert("you must be forgetful,please fill in the blank!")
    35 }

    36}

    37function reversechange(){
    38 var onestring=document.form1(0).value;
    39 if(onestring !=""){
    40            var temp=onestring.replace(/\\/g,"%");
    41            var temp1=unescape(temp);
    42            document.form1(5).value=temp1;
    43
    44 }
    else{
    45  alert("you must be forgetful,please fill in the blank!")
    46 }

    47}

    48function copyresult(){
    49        var e=document.getElementById("result"); 
    50        if(e.value==""){
    51        window.clipboardData.setData("Text","告訴你個秘密,其實剛才什么也沒復制上,哈哈哈哈,傻了吧!");
    52          return;
    53        }

    54        e.select(); 
    55        document.execCommand("Copy"); 
    56    }
     
    57
    </script>    
    58</head>
    59<body>
    60<form name="form1">
    61 請您輸入字符串: <input name="inputstring" type="text" size="100%" >&nbsp;&nbsp;<br><br><br>
    62                  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    63                  <input type="button" ONCLICK="change()" value="正向" class="button">  &nbsp;&nbsp;
    64                  <input type="button" ONCLICK="reversechange()" value="反向"  class="button"> &nbsp;&nbsp;
    65                  <input type="reset" onClick="clear"value="clear" class="button">&nbsp;&nbsp;
    66                  <input type="button" onClick="copyresult();"value="點擊復制轉換結果" class="button1"><br><br><br>
    67                  轉換結果:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <input type="text"  value="" name="result" size="100%" readonly>
    68
    69</form>
    70</body>
    71</html>
    72

    posted on 2007-08-30 16:52 peter2008 閱讀(1007) 評論(4)  編輯  收藏

    評論

    # re: 在用struts等編程時,中文轉換成資源文件unicode碼時的一個小程序 2007-08-30 17:27 JAVA面試題

    小弟剛接觸Java,瘋狂學習中。。。  回復  更多評論   

    # re: 在用struts等編程時,中文轉換成資源文件unicode碼時的一個小程序 2007-08-30 17:32 久城

    用JS實現的?我JS盲。看起來挺有意思。

    也可以寫成一個批處理文件。
    native2ascii a.properties b.properties  回復  更多評論   

    # re: 在用struts等編程時,中文轉換成資源文件unicode碼時的一個小程序 2007-08-30 23:23 popoer

    推薦一個eclipse的插件,可多語言同時編輯,自動保存成unicode編碼
    http://www.guh-software.de/jinto_en.html  回復  更多評論   

    # re: 在用struts等編程時,中文轉換成資源文件unicode碼時的一個小程序 2008-04-17 10:54 songxh

    真的很感謝啊  回復  更多評論   


    只有注冊用戶登錄后才能發表評論。


    網站導航:
     
    主站蜘蛛池模板: 亚洲欧洲国产综合| 亚洲欧洲在线播放| 免费无遮挡无码视频在线观看| 最新仑乱免费视频| 最新亚洲卡一卡二卡三新区| 国产成人精品免费午夜app | 免费看一区二区三区四区| 亚洲综合无码AV一区二区| 国产久爱免费精品视频| 久久久久亚洲AV成人网人人软件| 精品国产呦系列在线观看免费| 精品国产人成亚洲区| a毛看片免费观看视频| 久久亚洲精品成人综合| 中文字幕亚洲免费无线观看日本 | 亚洲精品无码永久在线观看| 一级毛片无遮挡免费全部| 亚洲日韩v无码中文字幕| 蜜桃视频在线观看免费视频网站WWW| 老司机亚洲精品影院| 噼里啪啦电影在线观看免费高清 | 亚洲第一永久在线观看| 四虎国产精品免费久久| 日韩亚洲人成在线综合| 亚洲一区二区三区在线观看精品中文 | 亚洲精品成人片在线观看精品字幕| 国产一区二区三区免费| 亚洲天堂电影在线观看| 午夜小视频免费观看| 一级做a免费视频观看网站| 91嫩草私人成人亚洲影院| 青春禁区视频在线观看直播免费| 免费国产污网站在线观看不要卡 | 亚洲色少妇熟女11p| 亚洲色图综合在线| 在线免费中文字幕| 欧洲亚洲国产精华液| 亚洲第一AAAAA片| 日韩精品免费电影| 少妇无码一区二区三区免费| 亚洲AV无码成人精品区狼人影院|