XML Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreXML Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old January 15th, 2004, 08:15 AM
superprogrammer superprogrammer is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Nov 2003
Posts: 758 superprogrammer User rank is Lance Corporal (50 - 100 Reputation Level)superprogrammer User rank is Lance Corporal (50 - 100 Reputation Level)superprogrammer User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 6 Days 10 h 7 m 31 sec
Reputation Power: 5
Send a message via AIM to superprogrammer Send a message via MSN to superprogrammer Send a message via Yahoo to superprogrammer
XMLHTTP character encoding problem - ?

Hi
I am getting problems in display of ASP files
Everything is working fine on this site
http://dmoz.org/World/
But when I import this data to my site there is some problem
http://www.amiwired.com/directory.asp?ID=/World/
See the strange characters as in like
Catalan?b Espa?b etc
You can download the two asp files which are being used here
file1
file2
Any help would be highly appreciated
Email me: advanced_programmer@hotmail.com
or IM me AIM: sandeepchn
Thanks

PS: dir.xyz is actually dir.asp and directory.xyz is actually
directory.asp, I changed the extensions so that you can
download them

Reply With Quote
  #2  
Old January 15th, 2004, 08:19 AM
superprogrammer superprogrammer is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Nov 2003
Posts: 758 superprogrammer User rank is Lance Corporal (50 - 100 Reputation Level)superprogrammer User rank is Lance Corporal (50 - 100 Reputation Level)superprogrammer User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 6 Days 10 h 7 m 31 sec
Reputation Power: 5
Send a message via AIM to superprogrammer Send a message via MSN to superprogrammer Send a message via Yahoo to superprogrammer
The problem is somewhere here
------------------------------------
<%
If Request("ID") = "" Then
Response.Redirect "index.asp"
End If
Function getit(strAdd,strFrom,strTo)
Dim objXMLHTTP, strGot, strSource
Set objXMLHTTP = Server.CreateObject("Microsoft.XMLHTTP")
objXMLHTTP.Open "GET", strAdd, False
objXMLHTTP.Send
strSource = objXMLHTTP.responseText
'strSource=server.URLEncode(strSource)
'strSource=server.htmlEncode(strSource)
Set objXMLHTTP = Nothing

Dim b,e
b=Instr(strSource,strFrom)
If b<>0 Then
b=b+Len(strFrom)
e=Instr(b,strSource,strTo)
strGot=Mid(strSource, b, e-b)
Else
Response.Write " "
End If

getit = strGot
End Function

dim Grabbed, CopyFrom, CopyTo

Grabbed = "http://dmoz.org/" & request.querystring("ID")
CopyFrom = "</form>"
CopyTo = "<table width=""95%"" cellpadding=0 cellspacing=0>"

Dim strSource
strSource = getit(Grabbed,CopyFrom,CopyTo)
strSource=Replace(strSource,"<b>","")
strSource=Replace(strSource,"</b>","")

'strSource=Replace(strSource,"ñ","ñ")
'strSource=Replace(strSource,"<li>","<br>")
'strSource=Replace(strSource,"<ul>"," ")
'strSource=Replace(strSource,"</ul>"," ")
strSource=Replace(strSource,"<hr>"," ")
strSource=Replace(strSource,"+1","2")

'strSource=Replace(strSource,"ñ","ñ")

Dim once, twice

once = Replace(strSource,"<a href=""desc.html","<a href=""http://dmoz.org/" & Request("ID") & "desc.html" & """" & " target=""_new")
twice = Replace(once,"href=""/","href=""directory.asp?ID=")
'twice =replace(twice,"ñ","ñ")
If twice = "" Then
%>
-------------------------------------------------

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreXML Programming > XMLHTTP character encoding problem - ?


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway
Stay green...Green IT