Miscellaneous
This part is not related with the programming...


Xara3d Sampler

I have made my logo with that utility.









CharCode

It's a usefull java app that i will surely use in my next application.

'); } function ConvertUCS4ToUTF8Array(code) // UCS-4 code to UTF-8 Array { var utf = new Array(0,0,0,0,0,0); var MaxCode = [0x7F,0x7FF,0xFFFF,0x1FFFFF,0x3FFFFFF,0x7FFFFFFF]; var FirstOctet = [0,0xC0,0xE0,0xF0,0xF8,0xFC]; var mo = 0; // bepaal aantal octetten while ((code>MaxCode[mo]) && (mo<5)) mo++; utf.length=mo+1; // vul achterste octetten for (var i=mo; i>0; i--) { utf[i]=0x80|(code&0x3F); code>>>=6; } // eerste octet utf[0]=FirstOctet[mo]|code; return utf; } function ConvertUTF8ArrayToUCS4(utf) // UTF-8 Array to UCS-4 code { var MaxCode = [0x7F,0x7FF,0xFFFF,0x1FFFFF,0x3FFFFFF,0x7FFFFFFF]; var FirstOctet = [0,0xC0,0xE0,0xF0,0xF8,0xFC]; var code=0, shift=0; var mo=utf.length-1; // max octet nummer if ((mo<0) || (mo>6) || isNaN(utf[0])) return Number.NaN; // invalid UTF-8 if (mo==0) // ASCII-char is uitzondering { if (utf[0]0; i--, shift+=6) { if ((utf[i]&0xC0)==0x80) // valid UTF-8 code|=(utf[i]&0x3F)<>1)|0x80))==FirstOctet[mo]) code|=(utf[0]&(~FirstOctet[mo]))<6)) return Number.NaN; // invalid UTF-8 if (mo==0) // ASCII-char is uitzondering { if (utf.charCodeAt(0)0; i--, shift+=6) { if ((utf.charCodeAt(i)&0xC0)==0x80) // valid UTF-8 code|=(utf.charCodeAt(i)&0x3F)<>1)|0x80))==FirstOctet[mo]) code|=(utf.charCodeAt(0)&(~FirstOctet[mo]))<=0xD800)&&(upperhalf<=0xDBFF)) { if ((lowerhalf>=0xDC00)&&(lowerhalf<=0xDFFF)) code=((upperhalf-0xD800)*400+(lowerhalf-0xDC00))+0x10000; else code=Number.NaN; } else if ((lowerhalf>=0xD800)&&(lowerhalf<=0xDBFF)) // verwisselde helften { if ((upperhalf>=0xDC00)&&(upperhalf<=0xDFFF)) code=((lowerhalf-0xD800)*400+(upperhalf-0xDC00))+0x10000; else code=Number.NaN; } else code=upperhalf; return code; } function ConvertUTF16ArrayToUCS4(utf) // UTF-16 Array to UCS-4 code { var code=Number.NaN; if (utf.length==1) // single character { if (!isNaN(utf[0]) && ((utf[0]>=0)&&(utf[0]<=0xD7FF)) || ((utf[0]>=0xE000)&&(utf[0]<=0xFFFD))) code=utf[0]; } else if (utf.length==2) // upper and lower half (v.v.) { if ((utf[0]>=0xD800)&&(utf[0]<=0xDBFF)) // upper half { if ((utf[1]>=0xDC00)&&(utf[1]<=0xDFFF)) code=((utf[0]-0xD800)*0x400+(utf[1]-0xDC00))+0x10000; } else if ((utf[0]>=0xDC00)&&(utf[0]<=0xDFFF)) // lower half { if ((utf[1]>=0xD800)&&(utf[1]<=0xDBFF)) // upper half code=((utf[1]-0xD800)*0x400+(utf[0]-0xDC00))+0x10000; } } return code; } function ConvertUCS4ToUTF16Array(code) { var utf = new Array(0,0); if ((code>=0)&&(code<=0xFFFD)&&!((code>=0xD800)&&(code<=0xDFFF))) { utf.length=1; utf[0]=code; } else if ((code>=0x10000)&&(code<=0x10FFFF)) { utf[0]=((code-0x10000)>>>10)+0xD800; utf[1]=((code-0x10000)&0x3FF)+0xDC00; } else utf.length=0; return utf; } function GenerateCharacterTable(code) // integer containing UCS-4 code { var cw = new OpenWindow(); //window; cw.document.open(); cw.status="Generating a "+this.Name+" character table ..."; this.WriteTable(cw.document,code); cw.status=cw.defaultStatus; cw.document.close(); } function ProcessCode(code) // integer containing UCS-4 code { // set the decimal code value window.document.CharCodeForm.DecimalCode.value=code.toString(10); // set the hexadecimal code value window.document.CharCodeForm.HexCode.value=code.toString(16).toUpperCase(); // set the character value window.document.CharCodeForm.Char.value=String.fromCharCode(code); // set the UTF-8 code value sequence var utf = ConvertUCS4ToUTF8Array(code); // set byte fields and convert to string var s=new String; for (var i=0; ics.MaxCode)) { document.CharCodeForm.DecimalCode.focus(); window.alert('The character code should be in the range '+cs.MinCode.toString(10)+'..'+cs.MaxCode.toString(10)); return false; } cs.ProcessCode(code); window.document.CharCodeForm.DecimalCode.focus(); return true; } function ProcessHexCode() { var cs = new CharacterSet(window.document.CharCodeForm.CharSet.value); var code = parseInt(document.CharCodeForm.HexCode.value,16); if ((code==null) || isNaN(code) || (codecs.MaxCode)) { document.CharCodeForm.HexCode.focus(); window.alert('The character code should be in the range '+cs.MinCode.toString(16)+'..'+cs.MaxCode.toString(16)); return false; } cs.ProcessCode(code); window.document.CharCodeForm.HexCode.focus(); return true; } function ProcessChar() { var cs = new CharacterSet(window.document.CharCodeForm.CharSet.value); var char = document.CharCodeForm.Char.value.charAt(0); if ((char==null) || (char.length<1)) { document.CharCodeForm.Char.focus(); window.alert('Please enter a character first!'); return false; } var code = char.charCodeAt(0); cs.ProcessCode(code); window.document.CharCodeForm.Char.focus(); return true; } function ProcessUTF8Code() { var cs = new CharacterSet(window.document.CharCodeForm.CharSet.value); var utf = new Array(0,0,0,0,0,0); for (var i=0; (i



 












code table
CharCode Site








Google

Google tool.

Google










Copyright 2004 Francis Gagnon


This website is hosted for free by Freewebs.com - free website. Get your own Free Website now!