HB_SETCODEPAGE( ) UTF-16

Post Reply
Marc Vanzegbroeck
Posts: 1163
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: 1163
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: 1163
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: 6557
Joined: Wed Feb 15, 2012 8:25 pm
Location: España
Been thanked: 3 times

Re: HB_SETCODEPAGE( ) UTF-16

Post by cnavarro »

You are tested this?

Code: Select all | Expand



//request HB_CODEPAGE_UTF8
request HB_CODEPAGE_UTF16LE

// and function hb_translate( cText, cPageOrigin, "UTF16LE" )
 
Cristobal Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
Marc Vanzegbroeck
Posts: 1163
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: 451
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: 807
Joined: Tue Oct 16, 2007 8:57 am
Location: New Taipei City, Taiwan
Has thanked: 1 time
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'
Best Regards,

Richard

Harbour 3.2.0dev (r2402101027) => Borland C++ v7.7 32bit
MySQL v8.0 /ADS v10
Harbour 3.2.0dev (r2011030937) => Borland C++ v7.4 64bit
Marc Vanzegbroeck
Posts: 1163
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: 807
Joined: Tue Oct 16, 2007 8:57 am
Location: New Taipei City, Taiwan
Has thanked: 1 time
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.
Best Regards,

Richard

Harbour 3.2.0dev (r2402101027) => Borland C++ v7.7 32bit
MySQL v8.0 /ADS v10
Harbour 3.2.0dev (r2011030937) => Borland C++ v7.4 64bit
Post Reply