473,327 Members | 1,892 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,327 software developers and data experts.

Foreign language and streamreader problem.

I have text file contains word in English language and in
foreign language and I include this text file as embedded
resource in

my project. VB.NET editor can display the foreign langue
of this text file.
create stream reader object to read from this file. The
object can read the data in text file but it seems when I
display it to

screen using streamreader.Readline method, word in foreign
language can not be display in the correct word. It is
displayed

as garbage font.
Do I miss somthing?
This is my code:
' Get the current assembly.
Dim Asm As [Assembly] = [Assembly].GetExecutingAssembly()
strName = Asm.GetName().Name + ".TestText.txt"
' Resources are named using a fully qualified name.
Dim strm As Stream = Asm.GetManifestResourceStream
(strName)

' Read the contents of the embedded file.
Dim reader As StreamReader = New StreamReader(strm)
msgbox( reader.readend )

Nov 20 '05 #1
1 2971
"Krich" <mr*****@hotmail.com> scripsit:
I have text file contains word in English language and in
foreign language and I include this text file as embedded
resource in

my project. VB.NET editor can display the foreign langue
of this text file.
create stream reader object to read from this file. The
object can read the data in text file but it seems when I
display it to

screen using streamreader.Readline method, word in foreign
language can not be display in the correct word. It is
displayed

as garbage font.
Do I miss somthing?
This is my code:
' Get the current assembly.
Dim Asm As [Assembly] = [Assembly].GetExecutingAssembly()
strName = Asm.GetName().Name + ".TestText.txt"
' Resources are named using a fully qualified name.
Dim strm As Stream = Asm.GetManifestResourceStream
(strName)

' Read the contents of the embedded file.
Dim reader As StreamReader = New StreamReader(strm)


Notice that there is a constructor available that accepts an encoding in
the 2nd parameter.

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>
Nov 20 '05 #2

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

Similar topics

9
by: Mangesh | last post by:
hi, I am using HTTPWebrequest object to download google results. in the response stream I am not getting some foreign characters eg. If I search "signo de pregunta", all the spanish characters are...
43
by: David Trimboli | last post by:
In a text, I might want to include a foreign language term. In print, this is typically shown with italics. For instance (asterisks represent italics): 'I thought it was only a kind of *cram,*...
47
by: Andy Dingley | last post by:
Assume an English language page, linking to a foreign history resource that's only available in a foreign language. Any suggestions on appropriate "best practice" markup, particularly regarding the...
0
by: Scott Ribe | last post by:
I've got a problem which I think may be a bug in Postgres, but I wonder if I'm missing something. Two tables, A & B have foreign key relations to each other. A 3rd table C, inherits from A. A...
5
by: Ross A. Finlayson | last post by:
Hi, I'm scratching together an Access database. The development box is Office 95, the deployment box Office 2003. So anyways I am griping about forms and global variables. Say for example...
1
by: Trond Engebråten | last post by:
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")
2
by: Jack Russell | last post by:
I have a file I read with streamreader If I put accented characters in the file i.e. &Annulerèà It ignores the foreign characters. Is there a way of reading these? Thanks Jack Russell
16
by: Hugh Janus | last post by:
Hi all, I posted a couple of weeks ago with what I thought was a problem with the file system reading accented characters however, after debugging line by line I have now found the true problem....
7
by: The Bicycling Guitarist | last post by:
If I have a foreign word, name or phrase in one of my pages, I use the lang attribute to specify the relevant language, e.g., <span lang="de">Manfred von Richthofen</span>. But what if I want to...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.