Re: Read from an Unicode file

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



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"
<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
locale
is using Cyrillic? If not then what is your current code page set to?

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

I've installed a Roman Keyboard and I've added a Russian Keyboard and
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



.



Relevant Pages

  • Re: sed: Nur den ersten Treffer ersetzen
    ... replaced by any other single character within any given `s' command. ... Branch to LABEL only if there has been a successful `s'ubstitution ... in which case the next cycle is started. ... Prev by Date: ...
    (de.comp.os.unix.shell)
  • Re: Right syntax for EXPRESSION
    ... Oh, and somewhere appropriate in your code, add a txtSheetno.setfocus if a character is incorrect. ... It mightn't be necessary if you remove the msgbox and put in an invisible label with the message (and a timer to hide it again) ... Somewhere appropriate on your form, add another label, change its text to your warning, change font color to red to make it stand out, and then set its visible property to false ... YourWarningLabel.visible = true 'display the warning message ...
    (microsoft.public.vb.general.discussion)
  • Re: Multi-Line XtickLabels
    ... >> multi-line string using sprintf, said string does not display ... Instead of creating a multi-line label, ... the newline character is displayed as a box. ...
    (comp.soft-sys.matlab)
  • Re: newbie: good Assembler book
    ... the label you see is not the label ... An addition of TITLE namespaces could go a long way to help Rosasm ... developers working on different titles (it could also help in OOP as it ... this would mean that at least 1 character would have to be ...
    (alt.lang.asm)