Re: Read from an Unicode file
- From: "Tony Proctor" <tony_proctor@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 1 Aug 2007 11:00:21 +0100
I don't normally use the InputB() function. However, I hope you know that
you should use Loc() and LOF() to determine whether you're at the end of the
file, and not use EOF(). Otherwise, you will get random bytes returned. I
would also recommend using FreeFile() rather than a hard-coded channel
number
Anyway, assuming your data file really is in Unicode then the code below
should read them. Maybe you could try reading them into a byte-array so that
you can examine the contents and confirm they're really the Unicode
character codes you expect, e.g.
Dim b() As Byte
b = InputB (4, #i)
If they are then the problem must be with the ANSI character currently
associated with your locale (i.e. not the Cyrillic one), or a problem with
the font associated with your label
Note that there is a newsgroup specifically for this type of question:
microsoft.public.win32.programmer.international
Tony Proctor
<fedesky@xxxxxxxxx> wrote in message
news:1185917541.799636.287440@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
On 30 Lug, 21:46, "Tony Proctor"locale
<tony_proctor@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
That doesn't really help me to help you
You say the file displays OK in notepad. Does that mean your current
is using Cyrillic? If not then what is your current code page set to?I've installed a Roman Keyboard and I've added a Russian Keyboard and
I am confused about your labels. Are you saying that the text does or
does-not display in labels? Can you show us the code you are using?
Tony Proctor
<fede...@xxxxxxxxx> wrote in message
news:1185821921.787438.37110@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
the support for the Cyrillic.
When I switch to the Russian keyboard I can write in every program
(for instance notepad) and save corectly too.
I've tryied many configurations in my project.
If I create a label with the Cyrillic code page and I write directly
in the property window I can see the Cyrillic world on the Form and
strange characters in the property windows (because it shows only ansi
characters).
The problem is that I could not see the Cyrillic words if take them
from a file save with notepad.
The code I used mostly is like this:
Dim txtline As String
Open "ukrain.txt" For Binary As #1
txtline = InputB(2, #1) ' always FF FE, skip them
label1.caption = InputB(4, #1)
Close #1
Or:
'TextBox1.Text = txtline
How can I solve it?
Thank you in advance,
Qwerty
.
- References:
- Re: Read from an Unicode file
- From: fedesky
- Re: Read from an Unicode file
- Prev by Date: Create optimised / resized images from VB
- Next by Date: Re: Reading XML from VB6
- Previous by thread: Re: Read from an Unicode file
- Next by thread: Re: List Box Highlighting
- Index(es):
Relevant Pages
|