Cascading Style Sheets Tutorial

Converted into the Chinese character coding Utf8

  //——– The Chinese character coding ————————// into Utf8 
  Function EncodeUtf8 (s1) 
  ( 
  Var s = escape (s1); 
  Var sa = s.split ("%"); 
  Var retV = ""; 
  If (sa [0]! = "") 
  ( 
  RetV sa = [0]; 
  ) 
  For (var i = 1; i <sa.length; i) 
  ( 
  If (sa [i]. Substring (0,1) == "u") 
  ( 
  RetV = Hex2Utf8 (Str2Hex (sa [i]. Substring (1,5))); 

  ) 
  Else retV = "%" sa [i]; 
  ) 

  Return retV; 
  ) 
  Function Str2Hex (s) 
  ( 
  Var c = ""; 
  Var n; 
  Var ss = "0123456789ABCDEF"; 
  Var digS = ""; 
  For (var i = 0; i <s.length; i) 
  ( 
  C = s.charAt (i); 
  N = ss.indexOf (c); 
  DigS = Dec2Dig (eval (n)); 

  ) 
  / / Return value; 
  Return digS; 
  ) 
  Function Dec2Dig (n1) 
  ( 
  Var s = ""; 
  Var n2 = 0; 
  For (var i = 0; i <4; i) 
  ( 
  N2 = Math.pow (2,3 - i); 
  If (n1> = n2) 
  ( 
  S ='1 '; 
  N1 = n1 - n2; 
  ) 
  Else 
  S ='0 '; 

  ) 
  Return s; 

  ) 
  Function Dig2Dec (s) 
  ( 
  Var retV = 0; 
  If (s.length == 4) 
  ( 
  For (var i = 0; i <4; i) 
  ( 
  RetV = eval (s.charAt (i)) * Math.pow (2, 3 - i); 
  ) 
  Return retV; 
  ) 
  Return -1; 
  ) 
  Function Hex2Utf8 (s) 
  ( 
  Var retS = ""; 
  Var tempS = ""; 
  Var ss = ""; 
  If (s.length == 16) 
  ( 
  TempS = "1110" s.substring (0, 4); 
  TempS = "10" s.substring (4, 10); 
  TempS = "10" s.substring (10,16); 
  Var sss = "0123456789ABCDEF"; 
  For (var i = 0; i <3; i) 
  ( 
  RetS = "%"; 
  Ss = tempS.substring (i * 8, (eval (i) 1) * 8); 



  RetS = sss.charAt (Dig2Dec (ss.substring (0,4))); 
  RetS = sss.charAt (Dig2Dec (ss.substring (4,8))); 
  ) 
  Return retS; 
  ) 
  Return ""; 
  ) 

Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • del.icio.us
  • Facebook
  • Google
  • DotNetKicks
  • DZone

Tags: css Chinese manual

Releated Posts

  • How quickly create a successful Chinese web2.0 site?
  • To: AJAX Chinese lessons
  • 95% of the site need to rewrite Chinese CSS-px and write in the difference between the em
  • AJAX Chinese in the Post resolved when the hash method.
  • CSS attributes usage Fast facts Manual (to)

This entry was posted on Tuesday, July 31st, 2007 at 12:00 am and is filed under CSS Tutorial. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

« JAVASCRIPT DIV used to replace non-spacing to achieve the effect of rolling news
JavaScript object-oriented support (6) »

Leave a Reply

  • Categories

    • CSS Properties (491)
    • CSS Tutorial (1154)
    • CSS Tutorial By Examples (1201)
    • Css+Div Web Design (3274)
    • Xhtml and Web Design (1797)
  • Archives

    • February 2008
    • January 2008
    • December 2007
    • November 2007
    • October 2007
    • September 2007
    • August 2007
    • July 2007
    • June 2007
    • May 2007
    • April 2007
    • March 2007
    • February 2007
    • January 2007
  • Pages

    • About us

Cascading Style Sheets Tutorial