473,405 Members | 2,287 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,405 software developers and data experts.

Convert DOS Cyrillic text to Unicode

How can I convert DOS cyrillic text to Unicode
Jul 21 '05 #1
17 4296
Nikolay Petrov <jo******@mail.bg> wrote:
How can I convert DOS cyrillic text to Unicode


See http://www.pobox.com/~skeet/csharp/unicode.html

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Jul 21 '05 #2
I have read this and other info in Unicode topic
My question is how can I do it in VB. I need the code.

"Jon Skeet [C# MVP]" <sk***@pobox.com> wrote in message
news:MP************************@msnews.microsoft.c om...
Nikolay Petrov <jo******@mail.bg> wrote:
How can I convert DOS cyrillic text to Unicode


See http://www.pobox.com/~skeet/csharp/unicode.html

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too

Jul 21 '05 #3
Nikolay Petrov <jo******@mail.bg> wrote:
I have read this and other info in Unicode topic
My question is how can I do it in VB. I need the code.


I provide some C# code to read a file in one encoding and write it in
another. It's very simple code - it should be easy to understand and
rewrite in VB.NET. The important thing is really just the creation of
the StreamReader with the right encoding.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Jul 21 '05 #4
My problem is that I don't read file.
The DOS Cyrillic text is pasted in a textbox, and should apear in another.
That's all.
I don't have anyting in Binary.
"Jon Skeet [C# MVP]" <sk***@pobox.com> wrote in message
news:MP************************@msnews.microsoft.c om...
Nikolay Petrov <jo******@mail.bg> wrote:
I have read this and other info in Unicode topic
My question is how can I do it in VB. I need the code.


I provide some C# code to read a file in one encoding and write it in
another. It's very simple code - it should be easy to understand and
rewrite in VB.NET. The important thing is really just the creation of
the StreamReader with the right encoding.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too

Jul 21 '05 #5
Hi Jon,

I pointed Nikolay in the language.VB newsgroup on you and Jay B, who has
answered a message in language.VB however as well not complete enough for
Nikolay. Jay B will probably not be active on this newsgroup before 13:00
GMT.

I am curious as well, what is the right encoding you think about for this
Cyrillic problem?

Nikolas wrote in the language VB group that he past it from a notepad
so I guess UTF16?

:-)

Cor

....
Nikolay Petrov <jo******@mail.bg> wrote:
I have read this and other info in Unicode topic
My question is how can I do it in VB. I need the code.


I provide some C# code to read a file in one encoding and write it in
another. It's very simple code - it should be easy to understand and
rewrite in VB.NET. The important thing is really just the creation of
the StreamReader with the right encoding.

--

Jul 21 '05 #6
Nikolay Petrov <jo******@mail.bg> wrote:
My problem is that I don't read file.
The DOS Cyrillic text is pasted in a textbox, and should apear in another.
That's all.
I don't have anyting in Binary.


If it's in a text box, you should have it as Unicode text already. All
strings are in Unicode in .NET.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Jul 21 '05 #7
Cor Ligthert <no**********@planet.nl> wrote:
I pointed Nikolay in the language.VB newsgroup on you and Jay B, who has
answered a message in language.VB however as well not complete enough for
Nikolay. Jay B will probably not be active on this newsgroup before 13:00
GMT.

I am curious as well, what is the right encoding you think about for this
Cyrillic problem?
Not sure - but it sounds like it won't actually be a problem, as if
he's got the data in notepad to start with, there's no encoding change
required - cut and paste should sort everything out.
Nikolas wrote in the language VB group that he past it from a notepad
so I guess UTF16?


No way - DOS precedes UTF16 by a long time!

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Jul 21 '05 #8
The user pasts text from text files, which contain DOS Cyrillic characters.
When they are pasted in text box or even in the Notepad windows they look
like garbage.
I am not sure, can I post a file here as attachment, so you can see it?

"Jon Skeet [C# MVP]" <sk***@pobox.com> wrote in message
news:MP************************@msnews.microsoft.c om...
Nikolay Petrov <jo******@mail.bg> wrote:
I have read this and other info in Unicode topic
My question is how can I do it in VB. I need the code.


I provide some C# code to read a file in one encoding and write it in
another. It's very simple code - it should be easy to understand and
rewrite in VB.NET. The important thing is really just the creation of
the StreamReader with the right encoding.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too

Jul 21 '05 #9
Nikolay Petrov <jo******@mail.bg> wrote:
The user pasts text from text files, which contain DOS Cyrillic characters.
What does he have the text open in? It sounds like the existing app is
probably not putting it into the clipboard in Unicode :(
When they are pasted in text box or even in the Notepad windows they look
like garbage.
Ah - I thought you meant he had it working in notepad to start with.
I am not sure, can I post a file here as attachment, so you can see it?


It's probably best if you email it to me.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Jul 21 '05 #10
Hi John,
It's probably best if you email it to me.


I am also interested in this question, so why not mail to the newsgroup?

Cor
Jul 21 '05 #11
Cor Ligthert <no**********@planet.nl> wrote:
It's probably best if you email it to me.


I am also interested in this question, so why not mail to the
newsgroup?


It's more that depending on the way of attaching the file, it might get
converted during the attachment process - that's less likely to happen
in a mail message.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Jul 21 '05 #12
> It's more that depending on the way of attaching the file, it might get
converted during the attachment process - that's less likely to happen
in a mail message.

So I wait the results and than you can maybe send it to me when all is
clear?

Cor
Jul 21 '05 #13
Cor Ligthert <no**********@planet.nl> wrote:
It's more that depending on the way of attaching the file, it might get
converted during the attachment process - that's less likely to happen
in a mail message.
So I wait the results and than you can maybe send it to me when all is
clear?


Yup, sure. I suspect there's nothing particularly interesting about the
file though - it's just I should be able to work out what encoding it's
in, so that if the OP *does* want to read it directly (rather than with
c'n'p) he should be able to.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Jul 21 '05 #14
Ok guys, I have mailed it to both of you

I'll also but some of this DOS text here, case anyone else is interested

???<?'? ?? 6 ?. 2004??".

"Jon Skeet [C# MVP]" <sk***@pobox.com> wrote in message
news:MP************************@msnews.microsoft.c om...
Nikolay Petrov <jo******@mail.bg> wrote:
The user pasts text from text files, which contain DOS Cyrillic characters.

What does he have the text open in? It sounds like the existing app is
probably not putting it into the clipboard in Unicode :(
When they are pasted in text box or even in the Notepad windows they

look like garbage.


Ah - I thought you meant he had it working in notepad to start with.
I am not sure, can I post a file here as attachment, so you can see it?


It's probably best if you email it to me.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too

Jul 21 '05 #15
New problem ;-(
Text is encoded partialy.
All calital letters are fine, and some of the lower, but not all.
What may coused this?

"Nikolay Petrov" <jo******@mail.bg> wrote in message
news:eE*************@TK2MSFTNGP10.phx.gbl...
How can I convert DOS cyrillic text to Unicode

Jul 21 '05 #16
Nikolay Petrov <jo******@mail.bg> wrote:
New problem ;-(
Text is encoded partialy.
At what stage?
All calital letters are fine, and some of the lower, but not all.
What may coused this?


No idea - are you saying the original files are corrupt, basically?

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Jul 21 '05 #17
Hi,

"Nikolay Petrov" <jo******@mail.bg> wrote in message news:<eu**************@TK2MSFTNGP10.phx.gbl>...
New problem ;-(
Text is encoded partialy.
All calital letters are fine, and some of the lower, but not all.
What may coused this?

"Nikolay Petrov" <jo******@mail.bg> wrote in message
news:eE*************@TK2MSFTNGP10.phx.gbl...
How can I convert DOS cyrillic text to Unicode


You did not answer Jon's question, but it was critical -
in what _program_ your user opens a text file with DOS Cyrillic?

I am working with Cyrillic encodings since 1995 :) so I dealt
with most of them, including CP-866.

The easiest way in your scenario would be:

Open that DOS Cyrillic .txt file in MS Word 2000 or newer,
choosing "Cyrillic (DOS)" encoding in the process:
http://ourworld.compuserve.com/homep.../cp_e.htm#open

Now your user should see normal Russian text - in Unicode already
converted by Word and can paste it itno your text box.

Otherwise, if you try to open a file that contains text in
DOS Cyrillic encoding in some regular MS Windows text editor,
you *will* see just gibberish - editor expects one of _Windows_
encodings, not a DOS one.

There are many more ways to get it done, say converter programs that
make "Cyrillic(Windows), 1251" text from your DOS Cyrillic text,
I18n-aware editors that - as Word - offer you to specify explicitely
what is the encoding of your file - such as
http://www.esperanto.mv.ru/UniRed/ENG/
etc., etc.

--
Regards,
Paul Gorodyansky
"Cyrillic (Russian): instructions for Windows and Internet":
http://RusWin.net
Russian On-screen Keyboard: http://Kbd.RusWin.net
Jul 21 '05 #18

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

Similar topics

10
by: Markus Ernst | last post by:
Hi I have a string such as Добро" that shows the cyrillic word "?????" in the browser. Now I played around with lots of examples and contributed functions in the manual...
35
by: Philipp Lenssen | last post by:
Does anybody have experience displaying Cyrillic in common browsers with common settings? I found the following page researching the topic, however I cannot display all characters in the table...
10
by: Nikolay Petrov | last post by:
How can I convert DOS cyrillic text to Unicode
8
by: Kirill Simonov | last post by:
Hi, Could anyone suggest me a simple IDE suitable for teaching Python as a first programming language to high school students? It is necessary that it has a good support for input/output in...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
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,...
0
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...
0
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...
0
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.