Re: How to read UTF-8 chars using VBA



I have lot of data in a text file (like address, department name...etc)
, these details contains "Welsh" chars (UK)
(a,e,i,o,u,y,w,A,E,I,O,U,Y,W with circumflex), I want to open and read
this file and fill the controls (combobox, listbox),
I have saved the file as Unicode and I tried UTF-8 format too. Hope
this gives more input...give me some logic so that I can try...like
inputB, strConv...I tried everything but I am getting some junk chars

once again Thanks

MSK.

On Dec 5, 11:54 am, "Tony Proctor"
<tony_proctor@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
VB uses Unicode internally. Hence, you have to convert the UTF-8 to Unicode
when loading it into the VB app. Controls generally use the current ANSI
code page rather than Unicode but the translation from Unicode will happen
transparently - you don't have to do it yourself. If the characters are not
appearing then it may be that those characters are not part of your current
ANSI code page. What locale are you using, and what characters are you
trying to display?

Tony Proctor

"MSK" <mannaikart...@xxxxxxxxx> wrote in messagenews:1165318371.806846.303470@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx> Thanks, but that code converts the UTF-8 chars into Unicode,again I am
losing the required chars, actually I want to show those special chars
as it is in the list box.

MSK.

Tony Proctor wrote:
Here's a link to some code that reads UTF-8 encoded data into a VB app:http://groups.google.ie/group/microsoft.public.vb.general.discussion/...





Tony Proctor

"MSK" <mannaikart...@xxxxxxxxx> wrote in message
news:1165312983.479419.100970@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hi,

I am currently developing some Word templates (office 2003) + VBA

I have a UTF-8 encoded text file...I wanted to read and show the
values into a list box...

The charactors are getting changed while reading and filling the
control...(but in the text file they are perfect)

I tried FSO and Open statement with Line input.. I dont know how to
Convert into normal chars..

How to resovle.. ?

Its bit urgent...give me some useful links

Many thanks.
MSK.- Hide quoted text -- Show quoted text -

.



Relevant Pages

  • Re: CFile ops using char or TCHAR
    ... >just noticed that my file handling class is working chars not TCHARs. ... >Do I need to be working in wide chars for CFile operations, ... you need to use the type of characters you want ... CE is heavily biased towards UNICODE. ...
    (microsoft.public.windowsce.embedded.vc)
  • Re: Display Chinese strings from Access Database
    ... Chinese characters are UNICODE. ... They seem to be like default VB controls but are different in working. ... [How To Read and Display UNICODE String on Visual Basic Form] ...
    (microsoft.public.vb.database)
  • Re: Special characters in shortcut menus
    ... caption of the shortcut bar. ... Many of the chars don't error but are unprintable. ... the ChrW function which supports UniCode chars from 1 to 65536, ... > Does anyone have or know where I can find a listing of special characters ...
    (microsoft.public.excel.programming)
  • Re: Is anything easier to do in java than in lisp?
    ... > Java chars are now just like C chars, only they are fixed to 16 bit ... they are not unicode chars. ... using the first 128 characters as-is and the last 128 characters only ... the claim that a java character is a Unicode character is not ...
    (comp.lang.lisp)
  • Re: Is anything easier to do in java than in lisp?
    ... > Java chars are now just like C chars, only they are fixed to 16 bit ... they are not unicode chars. ... using the first 128 characters as-is and the last 128 characters only ... the claim that a java character is a Unicode character is not ...
    (comp.lang.java)

Loading