473,382 Members | 1,389 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Reading foreign letters from text files

The typical foreign letters in the text file I read are missing. Has it
something to do with the declaration of the file?
Dim sr As StreamReader = File.OpenText("c:\MyFile.txt")
Nov 23 '05 #1
1 1193
You might want to try opening the file specifying the charset. For instance
create a new StreamReader using the system's default ANSI charset:

vb.net:
Dim sr as StreamReader = new StreamReader("c:\myfile.txt",
System.Text.Encoding.Default)

c#:
StreamReader sr = new StreamReader(@"c:\myfile.txt",
System.Text.Encoding.Default);

"Trond Engebråten" wrote:
The typical foreign letters in the text file I read are missing. Has it
something to do with the declaration of the file?
Dim sr As StreamReader = File.OpenText("c:\MyFile.txt")

Nov 23 '05 #2

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

Similar topics

4
by: Toffe | last post by:
Hi, I've got a problem with regular expressions and strings containing Swedish characters (åäö). I basically have a PHP script that highlights certain words in a text. I found the code...
12
by: Smash | last post by:
i have this function: ------------------------------------------------------------ function isAlfaNumeric(vnos,space) { if (space==false) { validRegExp = /^{0,}$/; } else { validRegExp =...
8
by: Phil Slater | last post by:
I'm trying to process a collection of text files, reading word by word. The program run hangs whenever it encounters a word with an accented letter (like rôle or passé) - ie something that's not a...
1
by: dalei | last post by:
I like to make foreign letters to appear in the textarea. For instance, when typing the letter 'a' on the keyboard, the Japanese letter &#+12449; would appear in the textarea. Could somebody...
23
by: gregf | last post by:
I have a paragraph of text pasted into a word document, it's in Polish, complete with polish characters. They show up just fine in word, but the program I use for web page programming, HomeSite,...
6
by: Jerome | last post by:
Hi, I've made an input page in asp.net and the records are saved BUT without the 'foreign letters' like é, ä, ü and so on!? What could be the problem? My SQL database accepts these letters...
11
by: Girish Sahani | last post by:
I wrote the following code to concatenate every 2 keys of a dictionary and their corresponding values. e.g if i have tiDict1 = tiDict1 = {'a':,'b':} i should get tiDict2={'ab':} and similarly for...
1
Auraomega
by: Auraomega | last post by:
Hi, I was wondering how I could read, char by char letters from a text document. I'm making a game, and I have decided this method is probably the easiest way to make maps with collision ect. I...
9
by: szclark | last post by:
Hello, I am trying to extract information from a file I have so that I can answer some questions on it, the problem I'm having is that it is returning back mostly gibberish and I really don't know...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.