Ir para conteúdo

Arquivado

Este tópico foi arquivado e está fechado para novas respostas.

*_Charles Potter_*

[Resolvido] "CAL�ADO " como resolver?

Recommended Posts

Isso acontece com informações vindas do banco de dados, Ajax ou com texto inserido manualmente no html?

Compartilhar este post


Link para o post
Compartilhar em outros sites

acentos no XMLHTTP , convertendo os dados em formato Binário para String , e dá uma olhada neste link, um conteúdo interessante.

 

 

<%
Public Function BinaryToString(xBinary)
	Dim Binary
	Dim RS, LBinary
	If VarType(xBinary)=8 Then Binary = MultiByteToBinary(xBinary) Else Binary = xBinary
	Const adLongVarChar = 201
	Set RS = CreateObject("ADODB.Recordset")
	LBinary = LenB(Binary)
	If LBinary>0 Then
		RS.Fields.Append "mBinary", adLongVarChar, LBinary
		RS.Open
		RS.AddNew
		RS("mBinary").AppendChunk Binary 
		RS.Update
		BinaryToString = RS("mBinary")
	Else
		BinaryToString = ""
	End If
	Set RS = Nothing
End Function

Public Function MultiByteToBinary(MultiByte)
	Dim RS, LMultiByte, Binary
	Const adLongVarBinary = 205
	Set RS = CreateObject("ADODB.Recordset")
	LMultiByte = LenB(MultiByte)
	If LMultiByte>0 Then
		RS.Fields.Append "mBinary", adLongVarBinary, LMultiByte
		RS.Open
		RS.AddNew
		RS("mBinary").AppendChunk MultiByte & ChrB(0)
		RS.Update
		Binary = RS("mBinary").GetChunk(LMultiByte)
	End If
	Set RS = Nothing
	MultiByteToBinary = Binary
End Function
'------------------------------------------------


'Declaração das variáveis
Dim objXmlHttp
Dim Url
Dim Conteudo

'Inicialização do objeto
Set objXmlHttp	= Server.CreateObject("MSXML2.XMLHTTP")
	 
'Url do Site
Url = "http://rss.uol.com.br/0,,EI4795,00.xml"
				
'Resgatando os dados da URL via HTTP
objXMLHttp.Open "GET", Url, False
objXMLHttp.Send

'Utilizando a função "BinaryToString" não haverá mais problemas com acentos.
Conteudo = BinaryToString(objXmlHttp.ResponseBody)

Response.ContentType = "text/xml"
Response.Write Conteudo

'Destruição do objeto
Set objXmlHttp	= Server.CreateObject("MSXML2.XMLHTTP")
%>

Compartilhar este post


Link para o post
Compartilhar em outros sites

Altera o charset para

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />

 

Poste o resultado.

Compartilhar este post


Link para o post
Compartilhar em outros sites

Tenta dessa forma então:

<%
Response.Charset="ISO-8859-1" 
%>

Compartilhar este post


Link para o post
Compartilhar em outros sites

e dá uma olhada neste link, um conteúdo interessante, pode esclarecer algumas coisas

Compartilhar este post


Link para o post
Compartilhar em outros sites

Ahe gente,

 

Agora resolveu o problema de exibição nos menus,, mas quando adiciono uma informação no banco de dados ela fica estranah:

 

testé -> ficou -> testé

 

O que faço?

Compartilhar este post


Link para o post
Compartilhar em outros sites

Qual banco de dados está utilizando?

Compartilhar este post


Link para o post
Compartilhar em outros sites

Altere o Collation para latin1_swedish_ci e o Character Set para latin1 -- cp1252 West European

Compartilhar este post


Link para o post
Compartilhar em outros sites

×

Informação importante

Ao usar o fórum, você concorda com nossos Termos e condições.