
' File= Includes\Utils.VBS

Option Explicit


Function getCommentsEnglish(strF)

	' Converts comments strings so that crlf will
	' show up on comments
	
	Dim iSize, i, sChar, str, iUnicode
	
	' First convert Farsi News to unicode numbers
	iSize = Len(strF)
	str = ""
	for i = 1 to iSize
		sChar = Mid(strF,i,1)
		iUnicode = AscW(sChar)
		if iUnicode = 13 then
			str = str & "<BR>"
		Else
			str = str & sChar
		End if  	
	Next
	getCommentsEnglish = str
	
End function

Function getUnicodeString(strF)

	Dim iSize, i, sUnicode, iUnicode
	' First convert Farsi News to unicode numbers
	iSize = Len(strF)
	sUnicode = ""
	for i = 1 to iSize
		iUnicode = AscW(Mid(strF,i,1))
		if iUnicode = 13 then
			sUnicode = sUnicode & "<BR>"
		Else
			sUnicode = sUnicode & "&#" & iUnicode & ";" 	
		End if  	
	Next
	getUnicodeString = sUnicode
	
End function
