UNICODE

 

Unicode is a presentation of numbers that the browser interprets as characters. It can be used to 'hide' bits of information from prying eyes. It is NOT encryption.

The code converts - say - letters like a b c to ab&99#;

Because it seemed that my email had been picked up by a spider, and I was getting a lot of sex spam, I converted my email addys on this site to Unicode. These are two little BASIC progs that I have written to make it easy.

The BASIC source code is below for those interested. Simple but effective!

They convert text to Unicode and Unicode to text. To use them you type in your email addy and "text2uni.exe" writes the code to a file in your c:\ drive. "uni2text.exe" takes Unicode and converts it to text.

Use the code in your text file, ( in c:\????), generated by text2uni and copy/paste it into the source code of your html page instead of the actual email name.

Email me if you want any further help. You can save the progs and use them off-line. As I have said often before, "You can trust the progs - no viruses - you can always find me!!"

===================================================================

EXAMPLE

Say your email address is myname@brown678.co.uk

Then your html source code will look like this :- <A HREF="mailto:myname@brown678.co.uk">

Run text2uni.exe and type in the file name you wish to use and then the text to convert (myname@brown678.co.uk)

Using NotePad, (or other text editor) load in the text file created by text2uni.exe. The Unicode you got by using text2uni.exe will look like this :-

&#109;&#121;&#110;&#097;&#109;&#101;&#064;&#098;&#114;&#111;&#119;&#110;&#054;&#055;
&#056;&#046;&#099;&#111;&#046;&#117;&#107;

You then - select all/copy/paste - the Unicode to replace the real name in your html page ( after "mailto:) like this :-

<A HREF="mailto:&#109;&#121;&#110;&#097;&#109;&#101;&#064;&#098;&#114;&#111;&#119;
&#110;&#054;&#055;&#056;&#046;&#099;&#111;&#046;&#117;&#107;">

You can use uni2text.exe, to convert the file back to text, to make sure that you have done all correctly.

========================================================================

PROGRAMS

"text2uni.exe"

"uni2text.exe"

 

===================================================================================

Source code for converting text to Unicode

cls

on error goto 1000

pr$="&#"

print "Type in the filename to which the code is to be saved eg c:\uni02.txt"

print "Do not use an active filename - IT WILL BE OVERWRITTEN!!"

input "(Best to save to root directory ie c:\)";f$

print "Type in text for conversion to Unicode"

line input ad$

open f$ for output as #1

for i%=1 to len(ad$)

a$=mid$(ad$,i%,1)

a%=asc(a$)

a1$=str$(a%)

a1$=mid$(a1$,2,len(a1$))

if len(a1$)=2 then a1$="0"+a1$

h$=pr$+a1$+";"

print h$;" ";a$

if ry$=" " then end

print #1,h$;

next i%

1000 close #1

print "Conversion Completed"

print "Code is in file ";f$;" Write it down!!"

print "Hit spacebar and then close the window"

print "Please note filename and location!"

ry$=input$(1)

end_

================================================================

Source code for converting Unicode to text.

cls

print "Do you want to see the instructions (y/n)";:ry$=input$(1)

ry$=ucase$(ry$)

if ry$="N" then 5

print" This prog takes any text file of Unicode and converts it to text.":?

print" If you use it for conversion of Unicode from within an html file"

print" then you will have to copy/paste the code from the html source code"

print" to a text file using Notepad or other text editor.

print" It is best to save the file to the root directory"

print" ie c:\filename.txt Make sure that you do not use a currently used description"

print" - THE FILE WILL BE OVER-WRITTEN!!"

PRINT" I suggest that you use something like c:\uni02.txt"

?:?:?

5 ?:?

on error goto 1000

print "Type in filename for conversion eg c:\uni02.txt"

input "Include directory and filename";f$

open f$ for input as #1

10 h$=input$(6,#1)

h$=mid$(h$,3,3)

n%=val(h$)

a$=chr$(n%)

print a$;

goto 10

1000 close #1

if err=53 then print "Can't find file ";f$:goto 1010

print

print "Conversion Completed"

1010 print "Hit spacebar to finish - then close window"

ry$=input$(1)

end_

=============================================================

BACK TO TECHNICAL INDEX