PC SOFT

FOROS PROFESIONALES
WINDEVWEBDEV y WINDEV Mobile

Inicio → WINDEV 2024 → [WD20] UTF-8 charset on MySQL in analysis
[WD20] UTF-8 charset on MySQL in analysis
Iniciado por guest, 18,sep. 2015 23:56 - 11 respuestas
Publicado el 18,septiembre 2015 - 23:56
Hello,

does anyone knows how to define a MySQL table in the Windev Analysis that is Unicode, using the utf-8 charset ?

Or do I need to do it in (SQL)code ? and if so, how can I use that table in my program if it's not defined in the analysis ?


grtz

Patrick
Publicado el 20,septiembre 2015 - 23:13
Hi Pattrick

in windows you no need to worry about that
"Unicode-enabled functions in Windows use UTF-16, it is also possible to work with data encoded in UTF-8 or UTF-7, which are supported in Windows as multibyte character set code pages."

but if you really need to use specific character-set, then try this function

http://doc.windev.com/en-US/…
Publicado el 21,septiembre 2015 - 09:42
try change character set in project description -> language ->various tab
Publicado el 21,septiembre 2015 - 19:09
I think I've explained my problem wrong.

When I define a MySQL table in the Windev Analysis, and I check it in a took like Navicat for example, I can see this for the DDL :

CREATE TABLE `XTrackGenre` (
`TrackGenreID` int(11) NOT NULL auto_increment,
`TrackID` int(11) default NULL,
`GenreID` int(11) default NULL,
`SubGenreID` int(11) default NULL,
PRIMARY KEY (`TrackGenreID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

the problem is the CHARSET of the Table, this needs to be UTF-8, but I can't find a way to define this in the analysis.
And I really need this, because my tables will contain Unicode characters

grtz

Patrick
Publicado el 21,septiembre 2015 - 22:18
Hi Patrick,

now I'm confused...

Why would you want a unicode charset in a table/file containing only INTs like the one you just declared?

And what happens if you declare at least ONE string field, and in the options, you set that field as unicode?

Best regards
Publicado el 21,septiembre 2015 - 22:27
Hello Fabrice,

the DDL-statements that I was showing are just as an example, the DDL-code for the real tables is a lot bigger, so I pasted the code of a small table, that doesn't need UTF-8

At least someone is awake :)
Publicado el 21,septiembre 2015 - 22:53
yep... but it doesn't answer my question...

what happens for a table where you define a field as UNICODE string?

Best regards
Publicado el 21,septiembre 2015 - 23:01
Hello Fabrice,

I've created a new table in the analysis, named "test", and it has two fields, the autonumbered field, and a textfield, wich I have set to unicode.
Languageparameters for this field are English - USA - Standard

I've compiled my program, and try to let it create the table on the MySQL server, and then I get this error :

native MySQL access error.
Error Number = 22

The following error was returned by the database:
Error number = <1115>.
Error message:
Unknown character set: 'ucs2'

So, the one-million-dollar-question now is : how can I make this work, with UTF-8 character-set

grtz

Patrick
Publicado el 21,septiembre 2015 - 23:25
I've did the test with a normal text-field in stead of a unicode text-field, and then I don't have any error, but the charset of my table is Latin-1 then :(

-- Table "test" DDL

CREATE TABLE `test` (
`testID` bigint(20) NOT NULL auto_increment,
`test` varchar(50) default NULL,
PRIMARY KEY (`testID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
Publicado el 22,septiembre 2015 - 11:28
Hello again,

two questions:

- are you using the native access or oledb/odbc?

- did you try the contrary: create the table in mysql, then import it's definition in the analysis?

Best regards
Publicado el 22,septiembre 2015 - 17:07
Hello Fabrice,

I'm using Native Access to the MySQL database.

I followed your advice, and made a simple two field table in MySQL with Navicat.
Then I imported it into my analysis and deleted the original table from the mysql-server.
When I try to create the table from within my program, I get this error :

native MySQL access error.
Error Number = 22

The following error was returned by the database:
Error number = <1115>.
Error message:
Unknown character set: 'ucs2'

and no table is created....

I've sent a support request to PCSoft yesterday-evening about this error, but until now, no response....
Publicado el 24,septiembre 2015 - 19:11
In the mean time I have contacted PCS support, and we found the cause of my problems.
The version of the MySQL server we are using is to low....

To test things at home (because upgrading the MySQL is something that can't be done right now) I've installed a MariaDB on my NAS.
And here things work without error.
I just need to find out what language settings I need to get fields with UTF-8 Charset