Re: How to read UTF-8 chars using VBA



Sounds like you need to confirm that it really is in UTF-8 first. Notepad
supports UTF-8 (check the Encoding box in the SaveAs dialog). If this box is
set to UTF-8, and Notepad displays the data correctly, maybe you could
provide us with a piece of your data. I'll then test it here

Tony Proctor

"MSK" <mannaikarthik@xxxxxxxxx> wrote in message
news:1165320647.097850.94510@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
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: Fedora, unicode, console
    ... > to get UTF-8 enabled in console? ... *all* the Unicode characters: Fedora has chosen a good one, ... > has not all UTF-8 chars, ... Well, in vim, if you know the Unicode reference, try ...
    (Fedora)
  • Re: convert from utf-8 to unicode(excel)
    ... Is there a possibility to properly convert under Windows from utf-8 ... encoding to unicode ... There is no problem in conversion when I do it in Notepad. ... a file marking encoding as UTF-8 and then save it marking encoding as ...
    (comp.editors)
  • Re: Notepad and UTF-8
    ... When I opened the files in Notepad they were all on one line each. ... tried copying them from Microsoft FrontPage where they looked okay in HTML ... but now all the files are ANSI instead of UTF-8. ... You could try to set up cygwin to use DOS line endings, ...
    (comp.infosystems.www.authoring.html)
  • Re: how to use tex file in utf-8
    ... file's encode that is utf-8. ... I use a tool that can do it.but after transform, winedt cannot open ... Could you please check with a unicode savvy ... Be careful with Notepad. ...
    (comp.text.tex)
  • Re: Convert UTF-8 -> ANSI not via UTF-16?
    ... The conversion between UTF-8 and UTF-16 is really fast and if you are not using a language that is mostly 2 byte chars the file size savings can be pretty significant. ... I remember also we discussed this Unicode topic in previous posts on ...
    (microsoft.public.vc.mfc)

Loading