473,811 Members | 3,736 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

encoding and saving of strange charaters

I am screen scraping a web page via GetResponseStre am and can't resave a
certain character in the stream:

Stream respStream = wResp.GetRespon seStream();
StreamReader reader = new StreamReader(re spStream, Encoding.ASCII) ; // have
also used other UTFx modes
String respHTML = reader.ReadToEn d();

There is a strange character on the web page; it is a extra long
hypen...like the one in MS Word that is used if you type in two normal
hypens. I read the character in and try to resave it to another HTML
file...but when I view the HTML file now, it just contains several non-ascii
characters.

Any idea how to preserse the strange characters? I don't know if things are
going amiss during the read or during the write of the new file (maybe the
new file and it only supports asii).

Any ideas?

Amil
Feb 7 '06 #1
0 1013

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
6132
by: Brahim Machkour | last post by:
Hello, I'm using JAXB to export/import data from/to a DB through XML files. Everything is working well. I would like also to be able to edit the file using an editor, typically XMLSpy. The problem is that within the XML the arabic text is encoded with strings such as "& #1578;& #1575;& #1585"... and using the editor, arabic does not appear, only the sequence of ascii strings i just mentioned. I edit manually and ...
1
1436
by: The Eeediot | last post by:
If you use the command UPDATE <tablename> SET <fieldname> = ' ... ' to update a CHAR or TEXT field there are some characters that can cause problems such as a single quote. Are there any other type of charaters like that? TIA
9
5799
by: Joe Blow | last post by:
Strange problem, Web pages encoded in utf-8 are appearing on customers' browsers as iso-western european. This means that characters like the British £ symbol get messed up. No amount of tinkering with browser settings or the server settings has helped. Any ideas what the root of the problem might be? The page in question is www.itchy-coo.com (displays fine on my browser, and other North American browsers, seemingly). I'd appreciate...
4
11542
by: H Lee | last post by:
Hi, I'm an XML newbie, and not sure if this is the appropriate newsgroup to post my question, so feel free to suggest other newgroups where I should post this message if this is the case. I'm having issues using XmlTextWriter, saving it out to a file with UTF8 encoding, and seeing "dirty", or "human unreadable" characters show up *right before* the XML declaration. I need to have the XML declaration state "encoding = utf-8", but also...
8
11994
by: pabv | last post by:
Hello all, I am having a few issues with encoding to chinese characters and perhaps someone might be able to assist. At the moment I am only able to see chinese characters when displayed as part of a datagrid. When an input textbox is displayed it does not display chinese characters, but rather the unicode characters stored in the mssql 2000 server backend.
5
8222
by: Lee | last post by:
Hi, I have a rich text box that can have hyperlinks ect within the text! when I save this data to file how should I do it? that is can I just save it as text? or do I need to serialize it beforehand to preserve the hyperlink info? thanks in advance
14
5786
by: Zoro | last post by:
My task is to read html files from disk and save them onto SQL Server database field. I have created an nvarchar(max) field to hold them. The problem is that some characters, particularly html entities, and French/German special characters are lost and/or replaced by a question mark. This is really frustrating. I have tried using StreamReader with ALL the encodings available and none work correctly. Each encoding handles some characters...
2
1762
by: hdf | last post by:
hi could you hlp me with this each time i draw reports from my sql database it display the following charaters don’t insted of the don't and you hlpme with this. it hpens every time some one enters thethis -> ' what caouse it ti disply the strange charaters any in fomation needed plz contact me
0
933
by: a | last post by:
hallo vs 2005 here on saving an htm file with a custom encoding (from the little arrow on the Save button in the file save dialog window) how to have the iso-8859-1 encoding ? I'm in Italy and in my opinion it is the most suitable for our country
0
9605
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10651
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10393
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10136
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7671
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5556
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4342
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3871
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3020
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.