HB_SETCODEPAGE( ) UTF-16

Post Reply
Marc Vanzegbroeck
Posts: 1102
Joined: Mon Oct 17, 2005 5:41 am
Location: Belgium
Contact:

HB_SETCODEPAGE( ) UTF-16

Post by Marc Vanzegbroeck »

Hi,

How can I set the codepage to UTF-16?
For UTF8, I can use HB_SETCODEPAGE( "UTF8" ), but HB_SETCODEPAGE( "UTF16" ) doesn't work.
Regards,
Marc

FWH32+xHarbour | FWH64+Harbour | BCC | DBF | ADO+MySQL | ADO+MariaDB | ADO+SQLite
Marc Vanzegbroeck
Posts: 1102
Joined: Mon Oct 17, 2005 5:41 am
Location: Belgium
Contact:

Re: HB_SETCODEPAGE( ) UTF-16

Post by Marc Vanzegbroeck »

Hi,

The problem is that I want to read an XML-file that is UTF-16 encoded in a dbf or memoread, but that does't work, it only works with an UTF-8 file.
Regards,
Marc

FWH32+xHarbour | FWH64+Harbour | BCC | DBF | ADO+MySQL | ADO+MariaDB | ADO+SQLite
Marc Vanzegbroeck
Posts: 1102
Joined: Mon Oct 17, 2005 5:41 am
Location: Belgium
Contact:

Re: HB_SETCODEPAGE( ) UTF-16

Post by Marc Vanzegbroeck »

I found a solution by using a external conversion-program 'CONVERTCP'
Regards,
Marc

FWH32+xHarbour | FWH64+Harbour | BCC | DBF | ADO+MySQL | ADO+MariaDB | ADO+SQLite
User avatar
cnavarro
Posts: 5792
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: HB_SETCODEPAGE( ) UTF-16

Post by cnavarro »

You are tested this?

Code: Select all


//request HB_CODEPAGE_UTF8
request HB_CODEPAGE_UTF16LE

// and function hb_translate( cText, cPageOrigin, "UTF16LE" )
 
C. Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
Si alguien te dice que algo no se puede hacer, recuerda que esta hablando de sus limitaciones, no de las tuyas.
Marc Vanzegbroeck
Posts: 1102
Joined: Mon Oct 17, 2005 5:41 am
Location: Belgium
Contact:

Re: HB_SETCODEPAGE( ) UTF-16

Post by Marc Vanzegbroeck »

Cristobal,

Thank you, that's working fine :)
Regards,
Marc

FWH32+xHarbour | FWH64+Harbour | BCC | DBF | ADO+MySQL | ADO+MariaDB | ADO+SQLite
User avatar
lubin
Posts: 404
Joined: Fri Dec 09, 2005 12:41 am
Location: Lima, Peru
Contact:

Re: HB_SETCODEPAGE( ) UTF-16

Post by lubin »

Marc Vanzegbroeck wrote:I found a solution by using a external conversion-program 'CONVERTCP'
Perfect Solution

Lubin Thank You
User avatar
richard-service
Posts: 583
Joined: Tue Oct 16, 2007 8:57 am
Location: New Taipei City, Taiwan
Contact:

Re: HB_SETCODEPAGE( ) UTF-16

Post by richard-service »

Marc Vanzegbroeck wrote:I found a solution by using a external conversion-program 'CONVERTCP'
Hi Marc,

How to find this external conversion-program 'CONVERTCP'
Regards,

Richard

Harbour 3.2.0dev (r1904111533)/xHarbour 1.2.3 Intl. (SimpLex) (Build 20180818) => Borland C++ v7.4
xHarbour 0.99.71 (SimpLex) => Borland C++ v5.5
MySQL v5.7 /ADS v12
Harbour 3.2.0dev (r1603181642) => Borland C++ v7.4 64bit
Marc Vanzegbroeck
Posts: 1102
Joined: Mon Oct 17, 2005 5:41 am
Location: Belgium
Contact:

Re: HB_SETCODEPAGE( ) UTF-16

Post by Marc Vanzegbroeck »

Regards,
Marc

FWH32+xHarbour | FWH64+Harbour | BCC | DBF | ADO+MySQL | ADO+MariaDB | ADO+SQLite
User avatar
richard-service
Posts: 583
Joined: Tue Oct 16, 2007 8:57 am
Location: New Taipei City, Taiwan
Contact:

Re: HB_SETCODEPAGE( ) UTF-16

Post by richard-service »

Marc Vanzegbroeck wrote:Richard,
Here is the link https://sourceforge.net/projects/convertcp/
Marc,
Thanks a lot. I got it.
Regards,

Richard

Harbour 3.2.0dev (r1904111533)/xHarbour 1.2.3 Intl. (SimpLex) (Build 20180818) => Borland C++ v7.4
xHarbour 0.99.71 (SimpLex) => Borland C++ v5.5
MySQL v5.7 /ADS v12
Harbour 3.2.0dev (r1603181642) => Borland C++ v7.4 64bit
Post Reply