Traditional chinese to simplified conversion script preview

March 3rd, 2007 by William Yang

In my previous post, I covered how I encountered a problem converting from traditional chinese to simplfieid chinese in unicode, and how I came up with a conversion script.

This is the test page for the conversion script.

Sample Code: | Download it

Show Code | Download this script

  1. <?
  2.  
  3. if ($_POST['Submit']) {
  4.   require_once('tradsimp.php');
  5.   $s = convert_trad_to_simp($_POST['t']);
  6.  
  7. }
  8.  
  9. ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  10. <html xmlns="http://www.w3.org/1999/xhtml">
  11. <head>
  12. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  13. <title>Convert from traditional chinese to simplified chinese in unicode</title>
  14. <style type="text/css">
  15. <!--
  16. .style1 {font-family: Arial, Helvetica, sans-serif}
  17. -->
  18. </style>
  19. </head>
  20. <body>
  21. <form id="form1" name="form1" method="post" action="">
  22.   <label>
  23.   <span class="style1">Traditional Chinese<br />
  24.   <br />
  25.   <textarea name="t" cols="40" id="t"></textarea>
  26.   </span></label>
  27.   <p class="style1">Simplified Chinese</p>
  28.   <p class="style1">
  29.     <label>
  30.     <textarea name="s" cols="40" id="s"><?=$s; ?></textarea>
  31.     </label>
  32.   </p>
  33.   <p>
  34.     <span class="style1">
  35.     <label>
  36.     <input type="submit" name="Submit" value="Convert" />
  37.     </label>
  38.   </span>  </p>
  39. </form>
  40.  
  41. </body>
  42. </html>
  43.  

2 comments to “Traditional chinese to simplified conversion script preview”

  1. Comment by Tiaon Lab » Blog Archive » Convert between traditional and simplified chinese in unicode format:

    […] Traditional chinese to simplified conversion script preview » […]

  2. Comment by admin:

    Yes, it works, thank you for such good script.

Leave a Reply