Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.clipper.visual-objects > #8529
| Path | csiph.com!news.swapon.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail |
|---|---|
| From | "Uwe Heyer" <uwe.heyer@aristik.de> |
| Newsgroups | comp.lang.clipper.visual-objects |
| Subject | Re: create txt file with utf-8 |
| Date | 16 Oct 2015 20:18:44 GMT |
| Lines | 65 |
| Message-ID | <d8d4d4FqgidU1@mid.individual.net> (permalink) |
| References | <aa3c9200-dde0-4184-b8ab-fcb7310dc076@googlegroups.com> |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=iso-8859-1 |
| X-Trace | individual.net yGUfwoxADS3JX7y/01vZiAMcND96th/bEZjK6t1WWyKmjAIsyz |
| Cancel-Lock | sha1:HndEh1s4q5+JTFIdALnxLg+De4w= |
| User-Agent | XanaNews/1.18.1.6 |
| Xref | csiph.com comp.lang.clipper.visual-objects:8529 |
Show key headers only | View raw
moshe attia wrote:
> hi
> it create txt file
> and write the data in the file
> i need to write the file at utf-8 format
>
> .
> the project dump dbf file to svc
> and import the svc to mysql .
>
> when i import the file i recive at varchar ?????????
>
>
> moshe
--
Hi moshe,
you need a convert to wide_char first
MultiByteToWideChar(CP_ACP, ....)
second, convert above result to multi_byte
WideCharToMultiByte(CP_UTF8, ...)
first of both calls is the compute of needed spaces
see below (an example in Power Basic)
' Konvertiert ANSI nach UTF-8
FUNCTION PBAnsiToUtf8(BYVAL sString AS STRING) EXPORT AS STRING
LOCAL sBuffer AS STRING
LOCAL nLength AS LONG
nLength = MultiByteToWideChar(%CP_ACP, 0, BYVAL STRPTR(sString),
-1, BYVAL 0, 0)
sBuffer = NUL$(nLength * 2)
MultiByteToWideChar(%CP_ACP, 0, BYVAL STRPTR(sString), -1, BYVAL
STRPTR(sBuffer), nLength)
nLength = WideCharToMultiByte(%CP_UTF8, 0, BYVAL STRPTR(sBuffer),
-1, BYVAL 0, 0, BYVAL (0), BYVAL (0))
sString = NUL$(nLength)
WideCharToMultiByte(%CP_UTF8, 0, BYVAL STRPTR(sBuffer), -1, BYVAL
STRPTR(sString), nLength, BYVAL (0), BYVAL (0))
FUNCTION = LEFT$(sString, LEN(sString) - 1)
END FUNCTION
Ahoj
-Uwe
Back to comp.lang.clipper.visual-objects | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
create txt file with utf-8 moshe attia <attiamx@gmail.com> - 2015-10-16 08:35 -0700
Re: create txt file with utf-8 D.J.W. van Kooten <vankooten@removethis.ic2.com> - 2015-10-16 20:05 +0200
Re: create txt file with utf-8 Karl Faller <mail_withoutthat_@_drei-f_andthat_.de> - 2015-10-16 20:50 +0200
Re: create txt file with utf-8 D.J.W. van Kooten <vankooten@removethis.ic2.com> - 2015-10-19 11:54 +0200
Re: create txt file with utf-8 Karl Faller <mail_withoutthat_@_drei-f_andthat_.de> - 2015-10-19 14:01 +0200
Re: create txt file with utf-8 D.J.W. van Kooten <vankooten@removethis.ic2.com> - 2015-10-20 19:59 +0200
Re: create txt file with utf-8 Karl Faller <mail_withoutthat_@_drei-f_andthat_.de> - 2015-10-20 21:52 +0200
Re: create txt file with utf-8 "Uwe Heyer" <uwe.heyer@aristik.de> - 2015-10-16 20:18 +0000
Re: create txt file with utf-8 moshe attia <attiamx@gmail.com> - 2015-10-17 13:48 -0700
Re: create txt file with utf-8 "Arne Ortlinghaus" <Arne.Ortlinghaus@acs.it> - 2015-10-21 17:00 +0200
csiph-web