UTF8 & MySql are 100% compatible with FWH?
UTF8 & MySql are 100% compatible with FWH?
Dear All,
I'm going to move to MySql and UTF8. Is it 100% compatible with latest FWH 16.04 and xHarbour (or Harbour)?
Thanks for suggestion.
I'm going to move to MySql and UTF8. Is it 100% compatible with latest FWH 16.04 and xHarbour (or Harbour)?
Thanks for suggestion.
Regards,
Dutch
FWH 19.01 / xHarbour Simplex 1.2.3 / BCC73 / Pelles C / UEStudio
FWPPC 10.02 / Harbour for PPC (FTDN)
ADS V.9 / MySql / MariaDB
R&R 12 Infinity / Crystal Report XI R2
(Thailand)
Dutch
FWH 19.01 / xHarbour Simplex 1.2.3 / BCC73 / Pelles C / UEStudio
FWPPC 10.02 / Harbour for PPC (FTDN)
ADS V.9 / MySql / MariaDB
R&R 12 Infinity / Crystal Report XI R2
(Thailand)
- nageswaragunupudi
- Posts: 10721
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Been thanked: 8 times
- Contact:
Re: UTF8 & MySql are 100% compatible with FWH?
Yes.
We can also provide support if you are using MySql through ADO.
This is a working sample:
![Image](http://imagizer.imageshack.us/v2/xq90/922/8LaYr4.png)
We can also provide support if you are using MySql through ADO.
This is a working sample:
Code: Select all | Expand
#include "fivewin.ch"
#include "adodef.ch"
static oCn
//----------------------------------------------------------------------------//
function Main()
local oRs, cSql, aStruct
local cTable := "namesutf8"
FW_SetUnicode( .t. )
? "Connecting to MySql Server"
oCn := FW_OpenAdoConnection( "MYSQL,localhost,fwh,root,India@1947", .t. )
if oCn == nil
? MsgStop( "Connect Fail" )
return nil
endif
if .not. FW_AdoTableExists( cTable, oCn ) .or. ;
MsgYesNo( "Recreate table " + cTable )
TRY
oCn:Execute( "DROP TABLE " + cTable )
CATCH
END
aStruct := { ;
{ "code", 'C', 2, 0 }, ;
{ "name", "VARCHAR(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci" } }
FWAdoCreateTable( cTable, aStruct, oCn )
endif
oRs := FW_OpenRecordSet( oCn, cTable )
XBROWSER oRs FASTEDIT TITLE FWVERSION
oRs:Close()
oCn:Close()
return nil
//----------------------------------------------------------------------------//
![Image](http://imagizer.imageshack.us/v2/xq90/922/8LaYr4.png)
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India
Re: UTF8 & MySql are 100% compatible with FWH?
Thank you so much Mr.Rao for your suggestion. I have a question.
If I need to use Unicode (2bytes), which the character set that FWH support (by FW_SetUnicode( .T. ))
Do I need to convert the database (DBF) to MySql (UCS2)? If so.
How to convert from DBF ANSI (TIS620) to MySql (UCS2 Charset).
I'm not quite sure my understanding now.
If I need to use Unicode (2bytes), which the character set that FWH support (by FW_SetUnicode( .T. ))
Do I need to convert the database (DBF) to MySql (UCS2)? If so.
How to convert from DBF ANSI (TIS620) to MySql (UCS2 Charset).
I'm not quite sure my understanding now.
Regards,
Dutch
FWH 19.01 / xHarbour Simplex 1.2.3 / BCC73 / Pelles C / UEStudio
FWPPC 10.02 / Harbour for PPC (FTDN)
ADS V.9 / MySql / MariaDB
R&R 12 Infinity / Crystal Report XI R2
(Thailand)
Dutch
FWH 19.01 / xHarbour Simplex 1.2.3 / BCC73 / Pelles C / UEStudio
FWPPC 10.02 / Harbour for PPC (FTDN)
ADS V.9 / MySql / MariaDB
R&R 12 Infinity / Crystal Report XI R2
(Thailand)
- nageswaragunupudi
- Posts: 10721
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Been thanked: 8 times
- Contact:
Re: UTF8 & MySql are 100% compatible with FWH?
If you propose to use xHarbour I suggest you use utf8 encoding of MySql.
Porting from DBF to MySql should be simple. Read from dbf and write to MySql table. Suggest creating MySql tables in the manner I suggested in the above example.
I understand TIS620 is specific to Thai. In the present days better to use more generic Unicode which makes the application to deal with any language in the world at the same time.
If you like, we can support conversion of some dbf tables as samples.
I suggest you try the sample I posted above. You can easily enter and edit Thai names in the table.
Porting from DBF to MySql should be simple. Read from dbf and write to MySql table. Suggest creating MySql tables in the manner I suggested in the above example.
I understand TIS620 is specific to Thai. In the present days better to use more generic Unicode which makes the application to deal with any language in the world at the same time.
If you like, we can support conversion of some dbf tables as samples.
I suggest you try the sample I posted above. You can easily enter and edit Thai names in the table.
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India
Re: UTF8 & MySql are 100% compatible with FWH?
Thank you Mr.Rao,
What is different between CHARSET=utf8 and utf8mb4?
I use "DEFAULT CHARSET=utf8" when create table. It show Thai Character in "MySql Query Browser" program correctly.
I use FW_SETUNICODE( .T. ) in the begining of the program but it show in "?" instead.
How can show UTF8 database in FWH? .or. What I do wrong?
![Image](http://s33.postimg.org/ua1lx04vz/My_Sql_UTF8.jpg)
image upload no size limit
What is different between CHARSET=utf8 and utf8mb4?
I use "DEFAULT CHARSET=utf8" when create table. It show Thai Character in "MySql Query Browser" program correctly.
I use FW_SETUNICODE( .T. ) in the begining of the program but it show in "?" instead.
How can show UTF8 database in FWH? .or. What I do wrong?
![Image](http://s33.postimg.org/ua1lx04vz/My_Sql_UTF8.jpg)
image upload no size limit
Regards,
Dutch
FWH 19.01 / xHarbour Simplex 1.2.3 / BCC73 / Pelles C / UEStudio
FWPPC 10.02 / Harbour for PPC (FTDN)
ADS V.9 / MySql / MariaDB
R&R 12 Infinity / Crystal Report XI R2
(Thailand)
Dutch
FWH 19.01 / xHarbour Simplex 1.2.3 / BCC73 / Pelles C / UEStudio
FWPPC 10.02 / Harbour for PPC (FTDN)
ADS V.9 / MySql / MariaDB
R&R 12 Infinity / Crystal Report XI R2
(Thailand)
- nageswaragunupudi
- Posts: 10721
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Been thanked: 8 times
- Contact:
Re: UTF8 & MySql are 100% compatible with FWH?
In UTF8, one character can be represented by 1 to 3 bytes. Maximum is 3 bytes. But some characters in some complex languages can not be accommodated even in 3 bytes. For this purpose there is an extended version of UTF8 known as utf8mb4 or utf8ex, etc. To the best of my knowledge, for Thai language normal utf8 should be enough.
In your case, by default you should be able to browse Thai language. But I can not immediately comment unless I know more.
First I request you to test the sample (without any changes) I provided and let me know if it is working. Based on that I can understand what must be the reason and advise you further.
In your case, by default you should be able to browse Thai language. But I can not immediately comment unless I know more.
First I request you to test the sample (without any changes) I provided and let me know if it is working. Based on that I can understand what must be the reason and advise you further.
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India
Re: UTF8 & MySql are 100% compatible with FWH?
Dear Mr.Rao,
I tested with your code, it can show correctly with ADO.
But I use TMySql or TDolphin to Fetch the datas from MySql and use the same data and same code of yours. It doesn't show correctly.
Do you know what is my problem?
![Image](http://s33.postimg.org/w3xxd6i7z/UTF8.png)
image hosting over 10mb
Thank you so much in advance,
I tested with your code, it can show correctly with ADO.
But I use TMySql or TDolphin to Fetch the datas from MySql and use the same data and same code of yours. It doesn't show correctly.
Do you know what is my problem?
Code: Select all | Expand
#include 'fivewin.ch'
#include "xbrowse.ch"
Static oServer
function main
FW_SetUnicode( .T. )
oServer:= TMYSQLSERVER():new( 'localhost', 'root', 'nimda', 3306)
IF oserver:lError
MSGALERT( "There was error connecting will check if there is connection to the server or user / password is incorrected")
Return Nil
Endif
oServer:selectdb("easyfo")
ShowxBr( oServer, 'namesutf8' )
return nil
*-----------------------*
Procedure ShowxBr( oServer, cTable )
local oqry, oDlg, oBrw
oqry:=oServer:Query( "SELECT * FROM "+lower(cTable) )
IF oqry:lError
? "It could not open the database "
Return
endif
oqry:end()
XBROWSER oqry FASTEDIT TITLE FWVERSION
return nil
![Image](http://s33.postimg.org/w3xxd6i7z/UTF8.png)
image hosting over 10mb
Thank you so much in advance,
Regards,
Dutch
FWH 19.01 / xHarbour Simplex 1.2.3 / BCC73 / Pelles C / UEStudio
FWPPC 10.02 / Harbour for PPC (FTDN)
ADS V.9 / MySql / MariaDB
R&R 12 Infinity / Crystal Report XI R2
(Thailand)
Dutch
FWH 19.01 / xHarbour Simplex 1.2.3 / BCC73 / Pelles C / UEStudio
FWPPC 10.02 / Harbour for PPC (FTDN)
ADS V.9 / MySql / MariaDB
R&R 12 Infinity / Crystal Report XI R2
(Thailand)
- nageswaragunupudi
- Posts: 10721
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Been thanked: 8 times
- Contact:
Re: UTF8 & MySql are 100% compatible with FWH?
If you insist on using TMySql or TDolphin, you need to ask their authors to provide Unicode compatibility. I understand they do not even support DateTime valtype, though I am not sure.
As far as FWH is concerned it works well with Unicode and we can offer support if you choose to use ADO. Obviously your problem has nothing to do with FWH.
As far as FWH is concerned it works well with Unicode and we can offer support if you choose to use ADO. Obviously your problem has nothing to do with FWH.
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India
Re: UTF8 & MySql are 100% compatible with FWH?
Dear Mr.Rao,
It means TMySql or TDolphin do not support MySql with CHARSET=UTF8.
Thank you so much for your time to check this case.
It means TMySql or TDolphin do not support MySql with CHARSET=UTF8.
Thank you so much for your time to check this case.
Regards,
Dutch
FWH 19.01 / xHarbour Simplex 1.2.3 / BCC73 / Pelles C / UEStudio
FWPPC 10.02 / Harbour for PPC (FTDN)
ADS V.9 / MySql / MariaDB
R&R 12 Infinity / Crystal Report XI R2
(Thailand)
Dutch
FWH 19.01 / xHarbour Simplex 1.2.3 / BCC73 / Pelles C / UEStudio
FWPPC 10.02 / Harbour for PPC (FTDN)
ADS V.9 / MySql / MariaDB
R&R 12 Infinity / Crystal Report XI R2
(Thailand)
Re: UTF8 & MySql are 100% compatible with FWH?
I not use TMySql, or TDolphin, but
You are tested with HB_SETCODEPAGE( "UTF8" ) ?
You are tested with HB_SETCODEPAGE( "UTF8" ) ?
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
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
- nageswaragunupudi
- Posts: 10721
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Been thanked: 8 times
- Contact:
Re: UTF8 & MySql are 100% compatible with FWH?
cnavarro wrote:I not use TMySql, or TDolphin, but
You are tested with HB_SETCODEPAGE( "UTF8" ) ?
Your suggestion is only for Harbour but not for xHarbour I mean SETCODEPAGE( "UTF8" ).
Still please let us know if you used successfully Unicode with TMysql or TDolphin.
In any case, I shall test with TDolphin in a few days and get back to you.
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India
- nageswaragunupudi
- Posts: 10721
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Been thanked: 8 times
- Contact:
Re: UTF8 & MySql are 100% compatible with FWH?
Just started testing with TDolphin.
Small test with harbour as I could find dolphin.lib ready with fwh.
![Image](http://imagizer.imageshack.us/v2/xq90/924/CwjQ8Y.png)
We can expect the same results with xHarbour too. I could edit unicode text in the cell and save it too.
So we can use TDolphin for Unicode. Probably TMySql also may behave the same way.
In case you created the table in my first sample, please try this sample too. You have the include file in fwh\include and dolphin.lib in fwh\lib folder for Harbour.
I shall do some more tests and get back.
Small test with harbour as I could find dolphin.lib ready with fwh.
Code: Select all | Expand
#include "FiveWin.Ch"
#include "tdolphin.ch"
static cpw := "xxxxxxx"
//----------------------------------------------------------------------------//
function Main()
local oDlg, oBrw, oFont
local oQry
FW_SetUnicode( .T. )
db()
oQry := TDolphinQry():New( "SELECT * FROM namesutf8", db() )
DEFINE FONT oFont NAME "Segoe UI" SIZE 0,-16
DEFINE DIALOG oDlg SIZE 500,300 PIXEL TITLE FWVERSION + " : TDolphin" ;
FONT oFont
@ 10,10 XBROWSE oBrw SIZE -10,-10 PIXEL OF oDlg ;
DATASOURCE oQry ;
COLUMNS "code", "name" ;
CELL LINES NOBORDER AUTOSORT FASTEDIT
WITH OBJECT oBrw
:nEditTypes := EDIT_GET
//
:CreateFromCode()
END
ACTIVATE DIALOG oDlg CENTERED
db():End()
return (0)
//----------------------------------------------------------------------------//
function db()
static oCn
if oCn == nil
CONNECT oCn ;
HOST "localhost" USER "root" PASSWORD cpw DATABASE "fwh"
endif
return oCn
//----------------------------------------------------------------------------//
![Image](http://imagizer.imageshack.us/v2/xq90/924/CwjQ8Y.png)
We can expect the same results with xHarbour too. I could edit unicode text in the cell and save it too.
So we can use TDolphin for Unicode. Probably TMySql also may behave the same way.
In case you created the table in my first sample, please try this sample too. You have the include file in fwh\include and dolphin.lib in fwh\lib folder for Harbour.
I shall do some more tests and get back.
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India
Re: UTF8 & MySql are 100% compatible with FWH?
Dear Mr.Rao & Cristobal,
I've got the same. I try the DATA of Mr.Rao but it is not successful as picture.
I use xharbour 1.2.3 & FWH 1509.
Does FWH1509 support UTF8?
![Image](http://s33.postimg.org/5ewsdpctr/UTF8.png)
uploading pictures
This is Mr.Rao sample.
![Image](http://s33.postimg.org/e8mcw7xgv/UTF8.png)
screen shot on pc
I've got the same. I try the DATA of Mr.Rao but it is not successful as picture.
I use xharbour 1.2.3 & FWH 1509.
Does FWH1509 support UTF8?
![Image](http://s33.postimg.org/5ewsdpctr/UTF8.png)
uploading pictures
This is Mr.Rao sample.
![Image](http://s33.postimg.org/e8mcw7xgv/UTF8.png)
screen shot on pc
Code: Select all | Expand
#include 'fivewin.ch'
#include "xbrowse.ch"
#include 'Tdolphin.ch'
Static oServer, oFont
function main
HB_SETCODEPAGE( "UTF8" )
FW_SetUnicode( .T. )
oServer:= ConnectMySql( 'localhost', 'root', 'nimda', 3306, 0, 'easyfo')
IF oserver:lError
MSGALERT( "There was error connecting will check if there is connection to the server or user / password is incorrected")
Return Nil
Endif
ShowxBr( oServer, 'namesutf8' )
return nil
*-----------------------*
Procedure ShowxBr( oServer, cTable )
local oqry, oDlg, oBrw, oErr
TRY
oqry:=oServer:Query( "SELECT * FROM "+lower(cTable) )
CATCH oErr
? "It could not open the database "
Return
END TRY
DEFINE FONT oFont NAME "Segoe UI" SIZE 0,-16
DEFINE DIALOG oDlg SIZE 500, 300 PIXEL TITLE FWVERSION FONT oFont
@ 0, 0 XBROWSE oBrw SIZE -10, -10 PIXEL OF oDlg ;
DATASOURCE oqry ;
COLUMNS "Code", "Name" ;
FASTEDIT NOBORDER LINES CELL AUTOSORT
oBrw:CreateFromCode()
// oDlg:oClient := oBrw
ACTIVATE DIALOG oDlg CENTER
// XBROWSER oqry FASTEDIT TITLE FWVERSION
oqry:end()
return nil
*-------------------------------------------------------------------------*
Function ConnectMySql( cServer, cUser, cPassword, nPort, nFlags, cDBName )
local oSvr, oErr
TRY
CONNECT oSvr HOST cServer ;
USER cUser ;
PASSWORD cPassword ;
PORT nPort ;
FLAGS nFlags;
DATABASE cDBName
CATCH oErr
MsgStop( hb_dumpvar( oErr ) )
RETURN NIL
END
Regards,
Dutch
FWH 19.01 / xHarbour Simplex 1.2.3 / BCC73 / Pelles C / UEStudio
FWPPC 10.02 / Harbour for PPC (FTDN)
ADS V.9 / MySql / MariaDB
R&R 12 Infinity / Crystal Report XI R2
(Thailand)
Dutch
FWH 19.01 / xHarbour Simplex 1.2.3 / BCC73 / Pelles C / UEStudio
FWPPC 10.02 / Harbour for PPC (FTDN)
ADS V.9 / MySql / MariaDB
R&R 12 Infinity / Crystal Report XI R2
(Thailand)
- nageswaragunupudi
- Posts: 10721
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Been thanked: 8 times
- Contact:
Re: UTF8 & MySql are 100% compatible with FWH?
FWH15.09 supports Unicode. There were improvements in subsequent versions, but FWH 1509 should work in this case. Here it is working for me with FWH1509 and Harbour.
![Image](http://imagizer.imageshack.us/v2/xq90/924/0iGq0i.png)
We need to see why it did not work there for you.
Note:
HB_SETCODEPAGE( "UTF8" ) does not make any difference in xHarbour.
![Image](http://imagizer.imageshack.us/v2/xq90/924/0iGq0i.png)
We need to see why it did not work there for you.
Note:
HB_SETCODEPAGE( "UTF8" ) does not make any difference in xHarbour.
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India
Re: UTF8 & MySql are 100% compatible with FWH?
Dear Mr.Rao,
I try Harbour & TDolphin as picture but I got 2 errors. How do I fix it?
![Image](http://s33.postimg.org/yt525n9wv/Dolphin_Error.png)
upload images free
Thanks in advance.
I try Harbour & TDolphin as picture but I got 2 errors. How do I fix it?
![Image](http://s33.postimg.org/yt525n9wv/Dolphin_Error.png)
upload images free
Thanks in advance.
Regards,
Dutch
FWH 19.01 / xHarbour Simplex 1.2.3 / BCC73 / Pelles C / UEStudio
FWPPC 10.02 / Harbour for PPC (FTDN)
ADS V.9 / MySql / MariaDB
R&R 12 Infinity / Crystal Report XI R2
(Thailand)
Dutch
FWH 19.01 / xHarbour Simplex 1.2.3 / BCC73 / Pelles C / UEStudio
FWPPC 10.02 / Harbour for PPC (FTDN)
ADS V.9 / MySql / MariaDB
R&R 12 Infinity / Crystal Report XI R2
(Thailand)