473,657 Members | 2,758 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.Re adline 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].GetExecutingAs sembly()
strName = Asm.GetName().N ame + ".TestText. txt"
' Resources are named using a fully qualified name.
Dim strm As Stream = Asm.GetManifest ResourceStream
(strName)

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

Nov 20 '05 #1
1 2990
"Krich" <mr*****@hotmai l.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.Re adline 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].GetExecutingAs sembly()
strName = Asm.GetName().N ame + ".TestText. txt"
' Resources are named using a fully qualified name.
Dim strm As Stream = Asm.GetManifest ResourceStream
(strName)

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


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
4918
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 missing in response stream. The same search in the internet explorer shows all the characters. I am sending all the required headers with the HTTPWebrequest. Following code is used to get gogle results
43
2881
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,* such as the Dale-men make for journeys in the wild,' said the Dwarf. 'So it is,' they answered. 'But we call it *lembas* or waybread, and it is more strengthening than any food made by Men, and it is more pleasant than *cram,* by all accounts.'
47
3226
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 scope of a lang attribute applied to a <a> element ? <p>Francisco de Miranda's <a href="http://www.simon-bolivar.org/bolivar/miranda_oci.html" title="Biography of Francisco de Miranda (in Spanish)" lang="es" >biography</a></p>
0
1418
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 stored procedure updates a row in C, adds a row each in B & C. I get an integrity violation. All the foreign keys are deferrable, and the stored procedure is called from within a transaction with constraints deferred. (And the foreign keys do refer to...
5
3328
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 I'm adding a customer. The Customer fields are mostly foreign keys that refer to primary keys in other tables, left join instead of junction tables at this point. So, when I want to add a customer record, I also need to add records to the other...
1
1206
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
1372
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
3420
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. I am storing a list of files in an XML file as a sort of database. Some of these filenames have accented characters (i.e. á é í ó ú or ñ). However, upon writing the filename to the XML file, the accented character is dropped. This causes a...
7
3340
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 say something like "Richthofen's Circus"? I don't have a screen reader installed, but I try to make my site as accessible as possible. I also try to use as much structural markup as possible. I don't know how a screen reader would voice <span...
0
8385
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8303
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
8723
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...
1
8502
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6162
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
4150
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...
0
4300
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1941
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1601
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.