Lasso UTF-8 Encoding without -Table option

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Lasso UTF-8 Encoding without -Table option

Jeremy Reynolds-2
Our company is trying to convert our Lasso based website (8.6) so that it
can display Chinese and foreign characters correctly.

We've converted our lasso pages from Latin1 to UTF-8 encoding with BOM.

We've also converted our MySQL data sources to UTF-8 unicode encoding.
We're running MySQL version 5.6.17

--------------------------------
Here's a couple of scenarios and the results:

Case 1: Access Chinese characters from a MySQL table with a PHP page
Result: displays correctly

Case 2: Display Chinese characters that are first stored in a lasso
variable on a Lasso page
Result: displays correctly

Case 3: Access Chinese characters stored in a MySQL table with a Lasso page
with the option -table
Result: displays correctly

    [var: 'Search_SQL'='SELECT * FROM Test_Table WHERE
    `Record_ID` = \'204261\' OR `Record_ID` = \'19567\'' + ';']

    [inline: -Table='Test_Table', -SQL = $Search_SQL, -MaxRecords=3,
-Database='CC']

Case 4: Access Chinese character from a MySQL table with a Lasso page
WITHOUT -table option
Result: does not display correctly.  Shows ??????? instead

    [var: 'Search_SQL'='SELECT * FROM Test_Table WHERE
    `Record_ID` = \'204261\' OR `Record_ID` = \'19567\'' + ';']

    [inline: -SQL = $Search_SQL, -MaxRecords=3, -Database='CC']
--------------------------------
What I suspect is that adding the -Table option forces it to go through
Lasso engine where-as leaving off -Table maybe contacts the MySQL engine
directly???

Not only would I prefer not having to add the -Table option but I also feel
like I could gain a better understanding of how Lasso is working under the
hood by being able to perform this action without the -Table option.
Could I ask for your help as far as what I can do to get the data as UTF-8
even without the -Table option being used?

#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: Lasso UTF-8 Encoding without -Table option

Marc Vos-3
AFAIK Lasso always needs the -table option to retrieve the correct character set.
Lasso contacts MySQL directly only via the -host option in a surrounding inline-statement.

- -
Marc



> On 11 dec. 2015, at 16:01, Jeremy Reynolds <[hidden email]> wrote:
>
> Our company is trying to convert our Lasso based website (8.6) so that it
> can display Chinese and foreign characters correctly.
>
> We've converted our lasso pages from Latin1 to UTF-8 encoding with BOM.
>
> We've also converted our MySQL data sources to UTF-8 unicode encoding.
> We're running MySQL version 5.6.17
>
> --------------------------------
> Here's a couple of scenarios and the results:
>
> Case 1: Access Chinese characters from a MySQL table with a PHP page
> Result: displays correctly
>
> Case 2: Display Chinese characters that are first stored in a lasso
> variable on a Lasso page
> Result: displays correctly
>
> Case 3: Access Chinese characters stored in a MySQL table with a Lasso page
> with the option -table
> Result: displays correctly
>
>    [var: 'Search_SQL'='SELECT * FROM Test_Table WHERE
>    `Record_ID` = \'204261\' OR `Record_ID` = \'19567\'' + ';']
>
>    [inline: -Table='Test_Table', -SQL = $Search_SQL, -MaxRecords=3,
> -Database='CC']
>
> Case 4: Access Chinese character from a MySQL table with a Lasso page
> WITHOUT -table option
> Result: does not display correctly.  Shows ??????? instead
>
>    [var: 'Search_SQL'='SELECT * FROM Test_Table WHERE
>    `Record_ID` = \'204261\' OR `Record_ID` = \'19567\'' + ';']
>
>    [inline: -SQL = $Search_SQL, -MaxRecords=3, -Database='CC']
> --------------------------------
> What I suspect is that adding the -Table option forces it to go through
> Lasso engine where-as leaving off -Table maybe contacts the MySQL engine
> directly???
>
> Not only would I prefer not having to add the -Table option but I also feel
> like I could gain a better understanding of how Lasso is working under the
> hood by being able to perform this action without the -Table option.
> Could I ask for your help as far as what I can do to get the data as UTF-8
> even without the -Table option being used?
>
> #############################################################
>
> This message is sent to you because you are subscribed to
>  the mailing list Lasso [hidden email]
> Official list archives available at http://www.lassotalk.com
> To unsubscribe, E-mail to: <[hidden email]>
> Send administrative queries to  <[hidden email]>


#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: Lasso UTF-8 Encoding without -Table option

stevepiercy
In an inline where you use the regular connection method, -table
is required in order to detect the character set of records in
the table.

In an inline where you use the -host connection method, you can
explicitly state the table encoding as follows with your SQL statement:

     inline(-host=array(
             -datasource='mysqlds',
             -name='localhost',
             -username='u',
             -password='p',
             -tableencoding='utf-8'),
         -sql=#sql);

I recall there was a problem with the documentation.
http://lasso.2283332.n4.nabble.com/Round-tripping-Chinese-characters-through-MySQL-and-Lasso-tt3259283.html#a3261448

--steve


On 12/11/15 at 4:17 PM, [hidden email] (Marc Vos) pronounced:

>AFAIK Lasso always needs the -table option to retrieve the correct character set.
>Lasso contacts MySQL directly only via the -host option in a surrounding inline-statement.
>
>- -
>Marc
>
>
>
>>On 11 dec. 2015, at 16:01, Jeremy Reynolds <[hidden email]> wrote:
>>
>>Our company is trying to convert our Lasso based website (8.6) so that it
>>can display Chinese and foreign characters correctly.
>>
>>We've converted our lasso pages from Latin1 to UTF-8 encoding with BOM.
>>
>>We've also converted our MySQL data sources to UTF-8 unicode encoding.
>>We're running MySQL version 5.6.17
>>
>>--------------------------------
>>Here's a couple of scenarios and the results:
>>
>>Case 1: Access Chinese characters from a MySQL table with a PHP page
>>Result: displays correctly
>>
>>Case 2: Display Chinese characters that are first stored in a lasso
>>variable on a Lasso page
>>Result: displays correctly
>>
>>Case 3: Access Chinese characters stored in a MySQL table with a Lasso page
>>with the option -table
>>Result: displays correctly
>>
>>[var: 'Search_SQL'='SELECT * FROM Test_Table WHERE
>>`Record_ID` = \'204261\' OR `Record_ID` = \'19567\'' + ';']
>>
>>[inline: -Table='Test_Table', -SQL = $Search_SQL, -MaxRecords=3,
>>-Database='CC']
>>
>>Case 4: Access Chinese character from a MySQL table with a Lasso page
>>WITHOUT -table option
>>Result: does not display correctly.  Shows ??????? instead
>>
>>[var: 'Search_SQL'='SELECT * FROM Test_Table WHERE
>>`Record_ID` = \'204261\' OR `Record_ID` = \'19567\'' + ';']
>>
>>[inline: -SQL = $Search_SQL, -MaxRecords=3, -Database='CC']
>>--------------------------------
>>What I suspect is that adding the -Table option forces it to go through
>>Lasso engine where-as leaving off -Table maybe contacts the MySQL engine
>>directly???
>>
>>Not only would I prefer not having to add the -Table option but I also feel
>>like I could gain a better understanding of how Lasso is working under the
>>hood by being able to perform this action without the -Table option.
>>Could I ask for your help as far as what I can do to get the data as UTF-8
>>even without the -Table option being used?
>>
>>#############################################################
>>
>>This message is sent to you because you are subscribed to
>>the mailing list Lasso [hidden email]
>>Official list archives available at http://www.lassotalk.com
>>To unsubscribe, E-mail to: <[hidden email]>
>>Send administrative queries to  <[hidden email]>
>
>
>#############################################################
>
>This message is sent to you because you are subscribed to
>the mailing list Lasso [hidden email]
>Official list archives available at http://www.lassotalk.com
>To unsubscribe, E-mail to: <[hidden email]>
>Send administrative queries to  <[hidden email]>

-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Steve Piercy              Website Builder              Soquel, CA
<[hidden email]>               <http://www.StevePiercy.com/>


#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: Lasso UTF-8 Encoding without -Table option

Jeremy Reynolds-2
Thanks for the replies Marc and Steve.

I'm going through and adding the -Table tag now.

For SQL queries that only reference a single table it's pretty
straight-forward.  What should I do when the SELECT calls more than one
table for an inner join for example.  What would I put for -Table ?

[Local: 'SQL_Search'='SELECT * FROM Y, X WHERE....]

[inline: -SQL = #SQL_Search, -MaxRecords=1, -Database='CC']
        [Local: 'Record_ID'=(Field: 'Record_ID')]
[/inline]

Jeremy

On Fri, Dec 11, 2015 at 3:53 PM, Steve Piercy - Website Builder <
[hidden email]> wrote:

> In an inline where you use the regular connection method, -table is
> required in order to detect the character set of records in the table.
>
> In an inline where you use the -host connection method, you can explicitly
> state the table encoding as follows with your SQL statement:
>
>     inline(-host=array(
>             -datasource='mysqlds',
>             -name='localhost',
>             -username='u',
>             -password='p',
>             -tableencoding='utf-8'),
>         -sql=#sql);
>
> I recall there was a problem with the documentation.
>
> http://lasso.2283332.n4.nabble.com/Round-tripping-Chinese-characters-through-MySQL-and-Lasso-tt3259283.html#a3261448
>
> --steve
>
>
> On 12/11/15 at 4:17 PM, [hidden email] (Marc Vos) pronounced:
>
>
> AFAIK Lasso always needs the -table option to retrieve the correct
>> character set.
>> Lasso contacts MySQL directly only via the -host option in a surrounding
>> inline-statement.
>>
>> - -
>> Marc
>>
>>
>>
>> On 11 dec. 2015, at 16:01, Jeremy Reynolds <
>>> [hidden email]> wrote:
>>>
>>> Our company is trying to convert our Lasso based website (8.6) so that it
>>> can display Chinese and foreign characters correctly.
>>>
>>> We've converted our lasso pages from Latin1 to UTF-8 encoding with BOM.
>>>
>>> We've also converted our MySQL data sources to UTF-8 unicode encoding.
>>> We're running MySQL version 5.6.17
>>>
>>> --------------------------------
>>> Here's a couple of scenarios and the results:
>>>
>>> Case 1: Access Chinese characters from a MySQL table with a PHP page
>>> Result: displays correctly
>>>
>>> Case 2: Display Chinese characters that are first stored in a lasso
>>> variable on a Lasso page
>>> Result: displays correctly
>>>
>>> Case 3: Access Chinese characters stored in a MySQL table with a Lasso
>>> page
>>> with the option -table
>>> Result: displays correctly
>>>
>>> [var: 'Search_SQL'='SELECT * FROM Test_Table WHERE
>>> `Record_ID` = \'204261\' OR `Record_ID` = \'19567\'' + ';']
>>>
>>> [inline: -Table='Test_Table', -SQL = $Search_SQL, -MaxRecords=3,
>>> -Database='CC']
>>>
>>> Case 4: Access Chinese character from a MySQL table with a Lasso page
>>> WITHOUT -table option
>>> Result: does not display correctly.  Shows ??????? instead
>>>
>>> [var: 'Search_SQL'='SELECT * FROM Test_Table WHERE
>>> `Record_ID` = \'204261\' OR `Record_ID` = \'19567\'' + ';']
>>>
>>> [inline: -SQL = $Search_SQL, -MaxRecords=3, -Database='CC']
>>> --------------------------------
>>> What I suspect is that adding the -Table option forces it to go through
>>> Lasso engine where-as leaving off -Table maybe contacts the MySQL engine
>>> directly???
>>>
>>> Not only would I prefer not having to add the -Table option but I also
>>> feel
>>> like I could gain a better understanding of how Lasso is working under
>>> the
>>> hood by being able to perform this action without the -Table option.
>>> Could I ask for your help as far as what I can do to get the data as
>>> UTF-8
>>> even without the -Table option being used?
>>>
>>> #############################################################
>>>
>>> This message is sent to you because you are subscribed to
>>> the mailing list Lasso [hidden email]
>>> Official list archives available at http://www.lassotalk.com
>>> To unsubscribe, E-mail to: <[hidden email]>
>>> Send administrative queries to  <[hidden email]>
>>>
>>
>>
>> #############################################################
>>
>> This message is sent to you because you are subscribed to
>> the mailing list Lasso [hidden email]
>> Official list archives available at http://www.lassotalk.com
>> To unsubscribe, E-mail to: <[hidden email]>
>> Send administrative queries to  <[hidden email]>
>>
>
> -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
> Steve Piercy              Website Builder              Soquel, CA
> <[hidden email]>               <http://www.StevePiercy.com/>
>
>
>
> #############################################################
>
> This message is sent to you because you are subscribed to
>  the mailing list Lasso [hidden email]
> Official list archives available at http://www.lassotalk.com
> To unsubscribe, E-mail to: <[hidden email]>
> Send administrative queries to  <[hidden email]>
>

#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: Lasso UTF-8 Encoding without -Table option

Jolle Carlestam-2
> 15 dec. 2015 kl. 20:52 skrev Jeremy Reynolds <[hidden email]>:
>
> For SQL queries that only reference a single table it's pretty
> straight-forward.  What should I do when the SELECT calls more than one
> table for an inner join for example.  What would I put for -Table ?

As long as all your tables use the same encoding, and I assume they do, it doesn't matter.
You could use the same table name on all your SQL inlines. To avoid confusion its probably a good idea to use a table that is actually used in the SQL. But that's to avoid human confusion and nothing else.

HDB
Jolle

Sent from a thin, flat, touchy device from an undetermined place in space.


#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: Lasso UTF-8 Encoding without -Table option

stevepiercy
In reply to this post by Jeremy Reynolds-2
-table will set the character set for the connection according
to the character set of the table specified by -table,
regardless of the SQL statement and however many tables you use.

See page 295 of the Lasso 8.6 Language Guide, under Database Connector.

--steve


On 12/15/15 at 2:52 PM, [hidden email]
(Jeremy Reynolds) pronounced:

>Thanks for the replies Marc and Steve.
>
>I'm going through and adding the -Table tag now.
>
>For SQL queries that only reference a single table it's pretty
>straight-forward.  What should I do when the SELECT calls more than one
>table for an inner join for example.  What would I put for -Table ?
>
>[Local: 'SQL_Search'='SELECT * FROM Y, X WHERE....]
>
>[inline: -SQL = #SQL_Search, -MaxRecords=1, -Database='CC']
>[Local: 'Record_ID'=(Field: 'Record_ID')]
>[/inline]
>
>Jeremy
>
>On Fri, Dec 11, 2015 at 3:53 PM, Steve Piercy - Website Builder <
>[hidden email]> wrote:
>
>>In an inline where you use the regular connection method, -table is
>>required in order to detect the character set of records in the table.
>>
>>In an inline where you use the -host connection method, you can explicitly
>>state the table encoding as follows with your SQL statement:
>>
>>inline(-host=array(
>>-datasource='mysqlds',
>>-name='localhost',
>>-username='u',
>>-password='p',
>>-tableencoding='utf-8'),
>>-sql=#sql);
>>
>>I recall there was a problem with the documentation.
>>
>>
>http://lasso.2283332.n4.nabble.com/Round-tripping-Chinese-characters-through-MySQL-and-
>Lasso-tt3259283.html#a3261448
>>
>>--steve
>>
>>
>>On 12/11/15 at 4:17 PM, [hidden email] (Marc Vos) pronounced:
>>
>>
>>AFAIK Lasso always needs the -table option to retrieve the correct
>>> character set.
>>> Lasso contacts MySQL directly only via the -host option in a surrounding
>>> inline-statement.
>>>
>>> - -
>>> Marc
>>>
>>>
>>>
>>> On 11 dec. 2015, at 16:01, Jeremy Reynolds <
>>>> [hidden email]> wrote:
>>>>
>>>> Our company is trying to convert our Lasso based website (8.6) so that it
>>>> can display Chinese and foreign characters correctly.
>>>>
>>>> We've converted our lasso pages from Latin1 to UTF-8 encoding with BOM.
>>>>
>>>> We've also converted our MySQL data sources to UTF-8 unicode encoding.
>>>> We're running MySQL version 5.6.17
>>>>
>>>> --------------------------------
>>>> Here's a couple of scenarios and the results:
>>>>
>>>> Case 1: Access Chinese characters from a MySQL table with a PHP page
>>>> Result: displays correctly
>>>>
>>>> Case 2: Display Chinese characters that are first stored in a lasso
>>>> variable on a Lasso page
>>>> Result: displays correctly
>>>>
>>>> Case 3: Access Chinese characters stored in a MySQL table with a Lasso
>>>> page
>>>> with the option -table
>>>> Result: displays correctly
>>>>
>>>> [var: 'Search_SQL'='SELECT * FROM Test_Table WHERE
>>>> `Record_ID` = \'204261\' OR `Record_ID` = \'19567\'' + ';']
>>>>
>>>> [inline: -Table='Test_Table', -SQL = $Search_SQL, -MaxRecords=3,
>>>> -Database='CC']
>>>>
>>>> Case 4: Access Chinese character from a MySQL table with a Lasso page
>>>> WITHOUT -table option
>>>> Result: does not display correctly.  Shows ??????? instead
>>>>
>>>> [var: 'Search_SQL'='SELECT * FROM Test_Table WHERE
>>>> `Record_ID` = \'204261\' OR `Record_ID` = \'19567\'' + ';']
>>>>
>>>> [inline: -SQL = $Search_SQL, -MaxRecords=3, -Database='CC']
>>>> --------------------------------
>>>> What I suspect is that adding the -Table option forces it to go through
>>>> Lasso engine where-as leaving off -Table maybe contacts the MySQL engine
>>>> directly???
>>>>
>>>> Not only would I prefer not having to add the -Table option but I also
>>>> feel
>>>> like I could gain a better understanding of how Lasso is working under
>>>> the
>>>> hood by being able to perform this action without the -Table option.
>>>> Could I ask for your help as far as what I can do to get the data as
>>>> UTF-8
>>>> even without the -Table option being used?
>>>>
>>>> #############################################################
>>>>
>>>> This message is sent to you because you are subscribed to
>>>> the mailing list Lasso [hidden email]
>>>> Official list archives available at http://www.lassotalk.com
>>>> To unsubscribe, E-mail to: <[hidden email]>
>>>> Send administrative queries to  <[hidden email]>
>>>>
>>>
>>>
>>> #############################################################
>>>
>>> This message is sent to you because you are subscribed to
>>> the mailing list Lasso [hidden email]
>>> Official list archives available at http://www.lassotalk.com
>>> To unsubscribe, E-mail to: <[hidden email]>
>>> Send administrative queries to  <[hidden email]>
>>>
>>
>>-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
>>Steve Piercy              Website Builder              Soquel, CA
>><[hidden email]>               <http://www.StevePiercy.com/>
>>
>>
>>
>>#############################################################
>>
>>This message is sent to you because you are subscribed to
>>the mailing list Lasso [hidden email]
>>Official list archives available at http://www.lassotalk.com
>>To unsubscribe, E-mail to: <[hidden email]>
>>Send administrative queries to  <[hidden email]>
>>
>
>#############################################################
>
>This message is sent to you because you are subscribed to
>the mailing list Lasso [hidden email]
>Official list archives available at http://www.lassotalk.com
>To unsubscribe, E-mail to: <[hidden email]>
>Send administrative queries to  <[hidden email]>

-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Steve Piercy              Website Builder              Soquel, CA
<[hidden email]>               <http://www.StevePiercy.com/>


#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>