Home All Groups Group Topic Archive Search About
Author
22 Nov 2006 5:24 AM
Aleks Kleyn
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.

Author
22 Nov 2006 8:09 AM
Master Programmer
Hi

Just use english instead.

Hope this helps
The Grand master


Aleks Kleyn wrote:
Show quoteHide quote
> 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.
Author
22 Nov 2006 5:30 PM
RobinS
This is not helpful.
Robin S.
--------------------------
Show quoteHide quote
"Master Programmer" <master_program***@outgun.com> wrote in message
news:1164182994.472861.300430@j44g2000cwa.googlegroups.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.
>
Author
23 Nov 2006 2:23 AM
Aleks Kleyn
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
Show quoteHide quote
"RobinS" <RobinS@NoSpam.yah.none> wrote in message
news:p46dnRvG6ZDXFPnYnZ2dnUVZ_oydnZ2d@comcast.com...
> This is not helpful.
> Robin S.
> --------------------------
> "Master Programmer" <master_program***@outgun.com> wrote in message
> news:1164182994.472861.300430@j44g2000cwa.googlegroups.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.
>>
>
>
Author
23 Nov 2006 4:25 AM
Aleks Kleyn
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
Author
23 Nov 2006 2:16 PM
Branco Medeiros
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.
Author
23 Nov 2006 7:46 PM
Aleks Kleyn
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
Author
22 Nov 2006 8:20 AM
FishingScout
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:
Show quoteHide quote
> 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.
Author
22 Nov 2006 8:21 AM
FishingScout
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:
Show quoteHide quote
> 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.