HB_SETCODEPAGE( ) UTF-16

HB_SETCODEPAGE( ) UTF-16

Postby Marc Vanzegbroeck » Sat Dec 01, 2018 10:19 pm

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: 1159
Joined: Mon Oct 17, 2005 5:41 am
Location: Belgium

Re: HB_SETCODEPAGE( ) UTF-16

Postby Marc Vanzegbroeck » Sun Dec 02, 2018 12:15 pm

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: 1159
Joined: Mon Oct 17, 2005 5:41 am
Location: Belgium

Re: HB_SETCODEPAGE( ) UTF-16

Postby Marc Vanzegbroeck » Sun Dec 02, 2018 1:08 pm

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
Marc Vanzegbroeck
 
Posts: 1159
Joined: Mon Oct 17, 2005 5:41 am
Location: Belgium

Re: HB_SETCODEPAGE( ) UTF-16

Postby cnavarro » Sun Dec 02, 2018 9:38 pm

You are tested this?

Code: Select all  Expand view


//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
User avatar
cnavarro
 
Posts: 6541
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: HB_SETCODEPAGE( ) UTF-16

Postby Marc Vanzegbroeck » Mon Dec 03, 2018 5:46 pm

Cristobal,

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

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

Re: HB_SETCODEPAGE( ) UTF-16

Postby lubin » Mon Jul 15, 2019 12:43 am

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


Perfect Solution

Lubin Thank You
User avatar
lubin
 
Posts: 449
Joined: Fri Dec 09, 2005 12:41 am
Location: Lima, Peru

Re: HB_SETCODEPAGE( ) UTF-16

Postby richard-service » Mon Jul 15, 2019 5:46 am

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
User avatar
richard-service
 
Posts: 803
Joined: Tue Oct 16, 2007 8:57 am
Location: New Taipei City, Taiwan

Re: HB_SETCODEPAGE( ) UTF-16

Postby Marc Vanzegbroeck » Mon Jul 15, 2019 12:14 pm

Regards,
Marc

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

Re: HB_SETCODEPAGE( ) UTF-16

Postby richard-service » Mon Jul 15, 2019 6:06 pm

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
User avatar
richard-service
 
Posts: 803
Joined: Tue Oct 16, 2007 8:57 am
Location: New Taipei City, Taiwan


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 107 guests