rfazendeiro Posted September 15, 2005 Posted September 15, 2005 Hi to all, I'm currently making a app that has to read 2 files and combine it all in one. The information is layout in lines. Something like this 000222333 23222323 Street number 27 6700-200 003343344 34556324 The Mall 24 5400-200 000003322 32233233 Street Hólând 33 3432-233 So i go through the lines and take the information. That easy because i have the position of each information so i can take it with Substring. Something like this string value = string.Empty; StreamReader sr = new StreamReader(@"C:\File.txt"); string sLineApolices = null; while((sLineApolices = srApolices.ReadLine()) != null) { value = sline.Substring(25, 38); } in this example i take the street name. All is fine except, as you can see, the last street name has an accentuated character "Street Hólând". This is where the problem is. It appears that substring method skips this characters. So in this case value has this information Street Hlnd 3 How can i make it recognize these character? Quote
rfazendeiro Posted September 15, 2005 Author Posted September 15, 2005 Anyone?? I really need some input on this....i'm a little lost here Quote
Administrators PlausiblyDamp Posted September 15, 2005 Administrators Posted September 15, 2005 When you create the stream reader you can specify then character encoding to use rather than letting it figure it out by itself. Just look at the overloads for it's constructor. Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.