By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
449,168 Members | 1,194 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 449,168 IT Pros & Developers. It's quick & easy.

Russian text output

P: n/a
I use vb code to show information from SQL Server on the screen. I have
Russian text in this data. Everything is fine, but when I save this
information into file using code
streamwriter1.write(...)
But when I look into file I see text which is different from text that I
wrote. How I can fix this problem?
Thank you, Aleks.

Nov 22 '06 #1
Share this Question
Share on Google+
8 Replies


P: n/a
Hi

Just use english instead.

Hope this helps
The Grand master
Aleks Kleyn wrote:
I use vb code to show information from SQL Server on the screen. I have
Russian text in this data. Everything is fine, but when I save this
information into file using code
streamwriter1.write(...)
But when I look into file I see text which is different from text that I
wrote. How I can fix this problem?
Thank you, Aleks.
Nov 22 '06 #2

P: n/a

I am assuming the text is unicode...

You need to make sure you are using a unicode font to view the text.
If you are opening the file to view it with notepad, make sure you have
a font like Arial Unicode selected.
Aleks Kleyn wrote:
I use vb code to show information from SQL Server on the screen. I have
Russian text in this data. Everything is fine, but when I save this
information into file using code
streamwriter1.write(...)
But when I look into file I see text which is different from text that I
wrote. How I can fix this problem?
Thank you, Aleks.
Nov 22 '06 #3

P: n/a

I am assuming the text is unicode...

You need to make sure you are using a unicode font to view the text.
If you are opening the file to view it with notepad, make sure you have
a font like Arial Unicode selected.
Aleks Kleyn wrote:
I use vb code to show information from SQL Server on the screen. I have
Russian text in this data. Everything is fine, but when I save this
information into file using code
streamwriter1.write(...)
But when I look into file I see text which is different from text that I
wrote. How I can fix this problem?
Thank you, Aleks.
Nov 22 '06 #4

P: n/a
This is not helpful.
Robin S.
--------------------------
"Master Programmer" <ma***************@outgun.comwrote in message
news:11**********************@j44g2000cwa.googlegr oups.com...
Hi

Just use english instead.

Hope this helps
The Grand master
Aleks Kleyn wrote:
>I use vb code to show information from SQL Server on the screen. I have
Russian text in this data. Everything is fine, but when I save this
information into file using code
streamwriter1.write(...)
But when I look into file I see text which is different from text that I
wrote. How I can fix this problem?
Thank you, Aleks.

Nov 22 '06 #5

P: n/a
I agree with this answer. I like when somebody decides which language and
for which purpose I should use. However I found answer
StreamWriter1 = New System.IO.StreamWriter("math.HO-0609472.tex",
False, System.Text.ASCIIEncoding.UTF8, 1000)
Because I selected to use Russian for code greater 128 this code works as I
expected.
Aleks
"RobinS" <Ro****@NoSpam.yah.nonewrote in message
news:p4******************************@comcast.com. ..
This is not helpful.
Robin S.
--------------------------
"Master Programmer" <ma***************@outgun.comwrote in message
news:11**********************@j44g2000cwa.googlegr oups.com...
>Hi

Just use english instead.

Hope this helps
The Grand master
Aleks Kleyn wrote:
>>I use vb code to show information from SQL Server on the screen. I have
Russian text in this data. Everything is fine, but when I save this
information into file using code
streamwriter1.write(...)
But when I look into file I see text which is different from text that I
wrote. How I can fix this problem?
Thank you, Aleks.

Nov 23 '06 #6

P: n/a
However it is not everything is good in this code. I use pdftex program to
convert tex file (here I create tex file using vb.net application) into pdf
file. However pdftex sees additional symbols in the start of each row. Now
the question is that I need to get rid of these symbols.
Aleks

Nov 23 '06 #7

P: n/a
On another post, Aleks Kleyn wrote:
StreamWriter1 = New System.IO.StreamWriter("math.HO-0609472.tex",
False, System.Text.ASCIIEncoding.UTF8, 1000)
Because I selected to use Russian for code greater 128 this code works as I
expected.
But then...
However it is not everything is good in this code. I use pdftex program to
convert tex file (here I create tex file using vb.net application) into pdf
file. However pdftex sees additional symbols in the start of each row. Now
the question is that I need to get rid of these symbols.
Are you sure pdftex can handle UTF8? UTF8 will encode specific chars
into two, three or four bytes. Specifically, it seems that the chars
from the range U+0080 to U+00FF (Ansi chars from 128 to 255) will be
encoded into two bytes. This may confuse some programs.

Because you mention "code greater [than] 128", I suppose you're
actually dealing with Ansi chars. If that's the case maybe using the
cyrillic Ansi charset will solve the problem:

StreamWriter1 = New System.IO.StreamWriter( _
"math.HO-0609472.tex", False, _
System.Text.Encoding.GetEncoding(1251), _
1000)

HTH.

Regards,

Branco.

Nov 23 '06 #8

P: n/a
Yes, it works. By the way, I use cp1251 encoding for Babel package. But it
was not clear how to match it from VB code. I also put attention that old
fashioned operator fileopen, printline also works.

Thank you, Aleks Kleyn

Nov 23 '06 #9

This discussion thread is closed

Replies have been disabled for this discussion.