Re: UTF-8
- From: Jason Keats <jkeats@xxxxxxxxxxxxxxxxxxxxxxx>
- Date: Sun, 07 Dec 2008 13:32:59 +1100
Tony Proctor wrote:
It depends Lou. If your locale is appropriate for the characters you want to show then it's easy. If not then it is difficult.
For instance, if your UTF-8 represents Chinese characters, and your locale is currently Chinese, then it's only a few lines of code. However, if your locale is something like West European then I'm not sure I have a reliable answer I can give you
I think someone suggested using a Web Browser control. That's probably the best solution I've heard in the difficult case since Internet Explorer takes care of it's own fonts for different locales
Here's a bit of code that will convert between UTF-8 from a file and Unicode (which is what VB uses in memory). The sample then writes the Unicode to a different ANSI file but you can just cut that bit out: http://groups.google.ie/group/microsoft.public.vb.general.discussion/msg/00f3c3fd8182563e?hl=en
Tony Proctor
I had no problems using Tony's code (in the link above) to load a sample UTF-8 text file into Edanmo's RichEdit Control v3 using a suitable Unicode font.
If the users have MS Office installed, then they will already have Arial Unicode MS (a suitable font for most languages).
So, go to http://www.mvps.org/emorcillo/en/code/vb6/index.shtml and get:
http://www.mvps.org/emorcillo/download/vb6/tl_ole.zip
http://www.mvps.org/emorcillo/download/vb6/ctl_riched.msi
The advantage of the above (over other suggestions) is that you can have several languages in the one box, and/or be able to edit them.
.
- References:
- Prev by Date: Re: RGB to CIELAB (or simply lab) color conversion
- Next by Date: Re: Automatic determine .Rows in MSHFLexgrid
- Previous by thread: Re: UTF-8
- Next by thread: Re: Astronomy Routines
- Index(es):
Relevant Pages
|