Deatil View with other language

If you're a new user of AppGini, feel free to ask general usage questions, or look for answers here.
Post Reply
Mcc
Posts: 3
Joined: 2013-01-28 15:46

Deatil View with other language

Post by Mcc » 2013-01-28 16:17

Hi, Needs help how to resolve the issues with chinese characters. It working perfect in the main page but not in the detail view. Any help is appreciated.
page-1.JPG
Main page
page-1.JPG (38.94 KiB) Viewed 8522 times
page-2.JPG
Detail View
page-2.JPG (56.95 KiB) Viewed 8522 times

User avatar
a.gneady
Site Admin
Posts: 1281
Joined: 2012-09-27 14:46
Contact:

Re: Deatil View with other language

Post by a.gneady » 2013-01-29 14:10

Hi Mcc,

This looks like a bug ... I'll inspect this and make a fix for it in the next release. Which character encoding did you specify in AppGini?
:idea: AppGini plugins to add more power to your apps:
  • DataTalk is an innovative AppGini plugin based on ChatGPT that allows you to interact with your AppGini database using natural language questions, without writing any SQL. Check the demo video
  • Mass Update plugin: Update multiple records at once and improve your workflow efficiency.
  • Check our other plugins and get a generous discount of up to 30% when buying 2 or more plugins.

Mcc
Posts: 3
Joined: 2013-01-28 15:46

Re: Deatil View with other language

Post by Mcc » 2013-01-30 01:05

Hi I'm using the Western without enforce Mysql encoding when I build the program.

User avatar
a.gneady
Site Admin
Posts: 1281
Joined: 2012-09-27 14:46
Contact:

Re: Deatil View with other language

Post by a.gneady » 2013-02-01 16:09

Umm ... Western wouldn't allow Chinese characters ... I thought you were using either Unicode or one of the 2 Chinese encodings supported in AppGini. Did you try any of these encodings?
:idea: AppGini plugins to add more power to your apps:
  • DataTalk is an innovative AppGini plugin based on ChatGPT that allows you to interact with your AppGini database using natural language questions, without writing any SQL. Check the demo video
  • Mass Update plugin: Update multiple records at once and improve your workflow efficiency.
  • Check our other plugins and get a generous discount of up to 30% when buying 2 or more plugins.

Mcc
Posts: 3
Joined: 2013-01-28 15:46

Re: Deatil View with other language

Post by Mcc » 2013-02-02 17:53

Hi, I been tries many other encoding without any luck. I also found some information on the web but I don't know where can I modify the PHP codes in
Appgini generated PHP files.



Below is some instruction I founded in the net and I tested and works.


<?php #MySQL-Input-Chinese-UTF8.php
# Copyright (c) 2007 by Dr. Herong Yang, http://www.herongyang.com/
#
print('<html><head>');
print('<meta http-equiv="Content-Type"'.
' content="text/html; charset=utf-8"/>');
print('</head><body>'."\n");

# Default input text
$input = '电视机/電視機';
$input_hex = 'E794B5E8A786E69CBA2FE99BBBE8A696E6A99F';

# Form submit detection
$submit = isset($_REQUEST["Submit"]);

# Process form input data
if ($submit) {
if (isset($_REQUEST["Input"])) {
$input = $_REQUEST["Input"];
}
$con = mysql_connect("localhost", "Herong", "TopSecret");
$ok = mysql_select_db("HerongDB", $con);
$test_name = "Input Chinese UTF-8";

# Set character_set_client and character_set_connection
mysql_query("SET character_set_client=utf8", $con);
mysql_query("SET character_set_connection=utf8", $con);

# Delete the record
$sql = "DELETE FROM Comment_Mixed WHERE Test_Name ='$test_name'";
mysql_query($sql, $con);

# Build the SQL INSERT statement
$sql = <<<END_OF_MESSAGE
INSERT INTO Comment_Mixed (Test_name, String_ASCII,
String_Latin1, String_UTF8, String_GBK, String_Big5)
VALUES ('$test_name', null, null, '$input', null, null);
END_OF_MESSAGE;

# Run the SQL statement
mysql_query($sql, $con);

mysql_close($con);
}

# Display form
print('<form>');
print('<input type="Text" size="40" maxlength="64"'
. ' name="Input" value="'.$input.'"/><br/>');
print('<input type="Submit" name="Submit" value="Submit"/>');
print('</form>'."\n");

# Generate reply
if ($submit) {
$con = mysql_connect("localhost", "Herong", "TopSecret");
$ok = mysql_select_db("HerongDB", $con);

# Set character_set_results
mysql_query("SET character_set_results=utf8", $con);

$sql = "SELECT * FROM Comment_Mixed"
. " WHERE Test_Name = '$test_name'";
$res = mysql_query($sql, $con);
$output = 'SELECT failed.';
if ($row = mysql_fetch_array($res)) {
$output = $row['String_UTF8'];
}
mysql_free_result($res);

print('<pre>'."\n");
print('Content-Type:'."\n");
print(' text/html; charset=utf-8'."\n");
print('You have submitted:'."\n");
print(' Text = '.$input."\n");
print(' Text in HEX = '.strtoupper(bin2hex($input))."\n");
print(' Default HEX = '.$input_hex."\n");
print('Saved and retrieved from database:'."\n");
print(' Text = '.$output."\n");
print(' Text in HEX = '.strtoupper(bin2hex($output))."\n");
print('</pre>'."\n");

mysql_close($con);
}

print('</body></html>');
?>

User avatar
a.gneady
Site Admin
Posts: 1281
Joined: 2012-09-27 14:46
Contact:

Re: Deatil View with other language

Post by a.gneady » 2013-02-07 11:22

I'm so sorry for the long delay. If the above code is working for you, try setting the encoding in AppGini to utf-8 and then, after generating the code, open the generated "lib.php" file and look for this line:

Code: Select all

@mysql_query("SET NAMES 'utf8'");
Then add this code below it:

Code: Select all

@mysql_query("SET character_set_client=utf8");
@mysql_query("SET character_set_connection=utf8");
Please let me know whether this works for you to implement it in future releases.
:idea: AppGini plugins to add more power to your apps:
  • DataTalk is an innovative AppGini plugin based on ChatGPT that allows you to interact with your AppGini database using natural language questions, without writing any SQL. Check the demo video
  • Mass Update plugin: Update multiple records at once and improve your workflow efficiency.
  • Check our other plugins and get a generous discount of up to 30% when buying 2 or more plugins.

gaetgodi
Posts: 1
Joined: 2014-03-17 15:44

Re: Deatil View with other language

Post by gaetgodi » 2014-03-17 15:46

what worked for me for French accents was Windows-1252 everywhere.

Post Reply