Encoding ñ Trouble

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

Encoding ñ Trouble

Marc Pinnell-3
According to the LP reference online I should be able to encode the ñ  
character with the encode_strictURL and back without problem (it is  
actually the example given online). However, I can't seem to make it  
work - what am I doing wrong?

<?lassoScript
        encode_Stricturl('Cañada');
        '<br />';
        decode_url('Ca%c3%92ada');
        '<br />';
        Encode_StrictURL: 'default.lasso?mañana=tomorrow';
        '<br />';
        decode_url('default.lasso%3fma%c3%92ana%3dtomorrow');
?>

This code returns:

Ca%c3%92ada

CaÒada

default.lasso%3fma%c3%92ana%3dtomorrow

default.lasso?maÒana=tomorrow

Thanx for any advice...

Marc
--
This list is a free service of LassoSoft: http://www.LassoSoft.com/
Search the list archives: http://www.ListSearch.com/Lasso/Browse/
Manage your subscription: http://www.ListSearch.com/Lasso/

Reply | Threaded
Open this post in threaded view
|

Re: Encoding ñ Trouble

stevepiercy
Remove Strict, unless you need it for something else:

<?lassoScript
    encode_url('Cañada');
    '<br />';
    decode_url('Ca%C3%B1ada');
    '<br />';
    Encode_URL: 'default.lasso?mañana=tomorrow';
    '<br />';
    decode_url('default.lasso?ma%C3%B1ana=tomorrow');
?>

--steve


On Wednesday, August 1, 2007, [hidden email] (Marc Pinnell) pronounced:

>According to the LP reference online I should be able to encode the ñ  
>character with the encode_strictURL and back without problem (it is  
>actually the example given online). However, I can't seem to make it  
>work - what am I doing wrong?
>
><?lassoScript
>   encode_Stricturl('Cañada');
>   '<br />';
>   decode_url('Ca%c3%92ada');
>   '<br />';
>   Encode_StrictURL: 'default.lasso?mañana=tomorrow';
>   '<br />';
>   decode_url('default.lasso%3fma%c3%92ana%3dtomorrow');
>?>
>
>This code returns:
>
>Ca%c3%92ada
>
>CaÒada
>
>default.lasso%3fma%c3%92ana%3dtomorrow
>
>default.lasso?maÒana=tomorrow
>
>Thanx for any advice...
>
>Marc

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

--
This list is a free service of LassoSoft: http://www.LassoSoft.com/
Search the list archives: http://www.ListSearch.com/Lasso/Browse/
Manage your subscription: http://www.ListSearch.com/Lasso/

Reply | Threaded
Open this post in threaded view
|

Re: Encoding ñ Trouble

Marc Pinnell-3
Doesn't help.

On Aug 1, 2007, at 3:59 PM, Steve Piercy - Web Site Builder wrote:

> Remove Strict, unless you need it for something else:
>
> <?lassoScript
>     encode_url('Cañada');
>     '<br />';
>     decode_url('Ca%C3%B1ada');
>     '<br />';
>     Encode_URL: 'default.lasso?mañana=tomorrow';
>     '<br />';
>     decode_url('default.lasso?ma%C3%B1ana=tomorrow');
> ?>
>
> --steve
>
>
> On Wednesday, August 1, 2007, [hidden email] (Marc  
> Pinnell) pronounced:
>
>> According to the LP reference online I should be able to encode the ñ
>> character with the encode_strictURL and back without problem (it is
>> actually the example given online). However, I can't seem to make it
>> work - what am I doing wrong?
>>
>> <?lassoScript
>>   encode_Stricturl('Cañada');
>>   '<br />';
>>   decode_url('Ca%c3%92ada');
>>   '<br />';
>>   Encode_StrictURL: 'default.lasso?mañana=tomorrow';
>>   '<br />';
>>   decode_url('default.lasso%3fma%c3%92ana%3dtomorrow');
>> ?>
>>
>> This code returns:
>>
>> Ca%c3%92ada
>>
>> CaÒada
>>
>> default.lasso%3fma%c3%92ana%3dtomorrow
>>
>> default.lasso?maÒana=tomorrow
>>
>> Thanx for any advice...
>>
>> Marc
>
> -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
> Steve Piercy               Web Site Builder               Soquel, CA
> <[hidden email]>                  <http://www.StevePiercy.com/>
>
> --
> This list is a free service of LassoSoft: http://www.LassoSoft.com/
> Search the list archives: http://www.ListSearch.com/Lasso/Browse/
> Manage your subscription: http://www.ListSearch.com/Lasso/
>


--
This list is a free service of LassoSoft: http://www.LassoSoft.com/
Search the list archives: http://www.ListSearch.com/Lasso/Browse/
Manage your subscription: http://www.ListSearch.com/Lasso/

Reply | Threaded
Open this post in threaded view
|

Re: Encoding ñ Trouble

stevepiercy
Strange.  My code yielded the following results:

Ca%C3%B1ada
Cañada
default.lasso?ma%C3%B1ana=tomorrow
default.lasso?mañana=tomorrow

I use UTF-8 with BOM for file encoding and UTF-8 for character sets.

Lasso 8.5.3.

--steve


On Wednesday, August 1, 2007, [hidden email] (Marc Pinnell) pronounced:

>Doesn't help.
>
>On Aug 1, 2007, at 3:59 PM, Steve Piercy - Web Site Builder wrote:
>
>> Remove Strict, unless you need it for something else:
>>
>> <?lassoScript
>>     encode_url('Cañada');
>>     '<br />';
>>     decode_url('Ca%C3%B1ada');
>>     '<br />';
>>     Encode_URL: 'default.lasso?mañana=tomorrow';
>>     '<br />';
>>     decode_url('default.lasso?ma%C3%B1ana=tomorrow');
>> ?>
>>
>> --steve
>>
>>
>> On Wednesday, August 1, 2007, [hidden email] (Marc  
>> Pinnell) pronounced:
>>
>>> According to the LP reference online I should be able to encode the ñ
>>> character with the encode_strictURL and back without problem (it is
>>> actually the example given online). However, I can't seem to make it
>>> work - what am I doing wrong?
>>>
>>> <?lassoScript
>>>   encode_Stricturl('Cañada');
>>>   '<br />';
>>>   decode_url('Ca%c3%92ada');
>>>   '<br />';
>>>   Encode_StrictURL: 'default.lasso?mañana=tomorrow';
>>>   '<br />';
>>>   decode_url('default.lasso%3fma%c3%92ana%3dtomorrow');
>>> ?>
>>>
>>> This code returns:
>>>
>>> Ca%c3%92ada
>>>
>>> CaÒada
>>>
>>> default.lasso%3fma%c3%92ana%3dtomorrow
>>>
>>> default.lasso?maÒana=tomorrow
>>>
>>> Thanx for any advice...
>>>
>>> Marc
>>
>> -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
>> Steve Piercy               Web Site Builder               Soquel, CA
>> <[hidden email]>                  <http://www.StevePiercy.com/>
>>
>> --
>> This list is a free service of LassoSoft: http://www.LassoSoft.com/
>> Search the list archives: http://www.ListSearch.com/Lasso/Browse/
>> Manage your subscription: http://www.ListSearch.com/Lasso/
>>
>
>

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

--
This list is a free service of LassoSoft: http://www.LassoSoft.com/
Search the list archives: http://www.ListSearch.com/Lasso/Browse/
Manage your subscription: http://www.ListSearch.com/Lasso/

Reply | Threaded
Open this post in threaded view
|

Re: Encoding ñ Trouble

Marc Pinnell-3
Interesting. I am on 8.5.3b1 and if I understand what you are saying  
I am on UTF-8 as well.

marc


On Aug 1, 2007, at 4:47 PM, Steve Piercy - Web Site Builder wrote:

> Strange.  My code yielded the following results:
>
> Ca%C3%B1ada
> Cañada
> default.lasso?ma%C3%B1ana=tomorrow
> default.lasso?mañana=tomorrow
>
> I use UTF-8 with BOM for file encoding and UTF-8 for character sets.
>
> Lasso 8.5.3.
>
> --steve
>
>
> On Wednesday, August 1, 2007, [hidden email] (Marc  
> Pinnell) pronounced:
>
>> Doesn't help.
>>
>> On Aug 1, 2007, at 3:59 PM, Steve Piercy - Web Site Builder wrote:
>>
>>> Remove Strict, unless you need it for something else:
>>>
>>> <?lassoScript
>>>     encode_url('Cañada');
>>>     '<br />';
>>>     decode_url('Ca%C3%B1ada');
>>>     '<br />';
>>>     Encode_URL: 'default.lasso?mañana=tomorrow';
>>>     '<br />';
>>>     decode_url('default.lasso?ma%C3%B1ana=tomorrow');
>>> ?>
>>>
>>> --steve
>>>
>>>
>>> On Wednesday, August 1, 2007, [hidden email] (Marc
>>> Pinnell) pronounced:
>>>
>>>> According to the LP reference online I should be able to encode  
>>>> the ñ
>>>> character with the encode_strictURL and back without problem (it is
>>>> actually the example given online). However, I can't seem to  
>>>> make it
>>>> work - what am I doing wrong?
>>>>
>>>> <?lassoScript
>>>>   encode_Stricturl('Cañada');
>>>>   '<br />';
>>>>   decode_url('Ca%c3%92ada');
>>>>   '<br />';
>>>>   Encode_StrictURL: 'default.lasso?mañana=tomorrow';
>>>>   '<br />';
>>>>   decode_url('default.lasso%3fma%c3%92ana%3dtomorrow');
>>>> ?>
>>>>
>>>> This code returns:
>>>>
>>>> Ca%c3%92ada
>>>>
>>>> CaÒada
>>>>
>>>> default.lasso%3fma%c3%92ana%3dtomorrow
>>>>
>>>> default.lasso?maÒana=tomorrow
>>>>
>>>> Thanx for any advice...
>>>>
>>>> Marc
>>>
>>> -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
>>> Steve Piercy               Web Site Builder               Soquel, CA
>>> <[hidden email]>                  <http://www.StevePiercy.com/>
>>>
>>> --
>>> This list is a free service of LassoSoft: http://www.LassoSoft.com/
>>> Search the list archives: http://www.ListSearch.com/Lasso/Browse/
>>> Manage your subscription: http://www.ListSearch.com/Lasso/
>>>
>>
>>
>
> -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
> Steve Piercy               Web Site Builder               Soquel, CA
> <[hidden email]>                  <http://www.StevePiercy.com/>
>
> --
> This list is a free service of LassoSoft: http://www.LassoSoft.com/
> Search the list archives: http://www.ListSearch.com/Lasso/Browse/
> Manage your subscription: http://www.ListSearch.com/Lasso/
>


--
This list is a free service of LassoSoft: http://www.LassoSoft.com/
Search the list archives: http://www.ListSearch.com/Lasso/Browse/
Manage your subscription: http://www.ListSearch.com/Lasso/

Reply | Threaded
Open this post in threaded view
|

Re: Encoding ñ Trouble

stevepiercy
Did you copy and paste my source code exactly?

When I copied and pasted your code into a file, I got the same results that you experienced.  I merely altered your code to use [encode_url] instead of [encode_stricturl].

--steve


On Wednesday, August 1, 2007, [hidden email] (Marc Pinnell) pronounced:

>Interesting. I am on 8.5.3b1 and if I understand what you are saying  
>I am on UTF-8 as well.
>
>marc
>
>
>On Aug 1, 2007, at 4:47 PM, Steve Piercy - Web Site Builder wrote:
>
>> Strange.  My code yielded the following results:
>>
>> Ca%C3%B1ada
>> Cañada
>> default.lasso?ma%C3%B1ana=tomorrow
>> default.lasso?mañana=tomorrow
>>
>> I use UTF-8 with BOM for file encoding and UTF-8 for character sets.
>>
>> Lasso 8.5.3.
>>
>> --steve
>>
>>
>> On Wednesday, August 1, 2007, [hidden email] (Marc  
>> Pinnell) pronounced:
>>
>>> Doesn't help.
>>>
>>> On Aug 1, 2007, at 3:59 PM, Steve Piercy - Web Site Builder wrote:
>>>
>>>> Remove Strict, unless you need it for something else:
>>>>
>>>> <?lassoScript
>>>>     encode_url('Cañada');
>>>>     '<br />';
>>>>     decode_url('Ca%C3%B1ada');
>>>>     '<br />';
>>>>     Encode_URL: 'default.lasso?mañana=tomorrow';
>>>>     '<br />';
>>>>     decode_url('default.lasso?ma%C3%B1ana=tomorrow');
>>>> ?>
>>>>
>>>> --steve
>>>>
>>>>
>>>> On Wednesday, August 1, 2007, [hidden email] (Marc
>>>> Pinnell) pronounced:
>>>>
>>>>> According to the LP reference online I should be able to encode  
>>>>> the ñ
>>>>> character with the encode_strictURL and back without problem (it is
>>>>> actually the example given online). However, I can't seem to  
>>>>> make it
>>>>> work - what am I doing wrong?
>>>>>
>>>>> <?lassoScript
>>>>>   encode_Stricturl('Cañada');
>>>>>   '<br />';
>>>>>   decode_url('Ca%c3%92ada');
>>>>>   '<br />';
>>>>>   Encode_StrictURL: 'default.lasso?mañana=tomorrow';
>>>>>   '<br />';
>>>>>   decode_url('default.lasso%3fma%c3%92ana%3dtomorrow');
>>>>> ?>
>>>>>
>>>>> This code returns:
>>>>>
>>>>> Ca%c3%92ada
>>>>>
>>>>> CaÒada
>>>>>
>>>>> default.lasso%3fma%c3%92ana%3dtomorrow
>>>>>
>>>>> default.lasso?maÒana=tomorrow
>>>>>
>>>>> Thanx for any advice...
>>>>>
>>>>> Marc
>>>>
>>>> -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
>>>> Steve Piercy               Web Site Builder               Soquel, CA
>>>> <[hidden email]>                  <http://www.StevePiercy.com/>
>>>>
>>>> --
>>>> This list is a free service of LassoSoft: http://www.LassoSoft.com/
>>>> Search the list archives: http://www.ListSearch.com/Lasso/Browse/
>>>> Manage your subscription: http://www.ListSearch.com/Lasso/
>>>>
>>>
>>>
>>
>> -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
>> Steve Piercy               Web Site Builder               Soquel, CA
>> <[hidden email]>                  <http://www.StevePiercy.com/>
>>
>> --
>> This list is a free service of LassoSoft: http://www.LassoSoft.com/
>> Search the list archives: http://www.ListSearch.com/Lasso/Browse/
>> Manage your subscription: http://www.ListSearch.com/Lasso/
>>
>
>

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

--
This list is a free service of LassoSoft: http://www.LassoSoft.com/
Search the list archives: http://www.ListSearch.com/Lasso/Browse/
Manage your subscription: http://www.ListSearch.com/Lasso/

Reply | Threaded
Open this post in threaded view
|

Re: Encoding ñ Trouble

Michael Coninx
In reply to this post by Marc Pinnell-3
When running the code below in an UTF-8 saved lasso file, it works fine.
However, when saving the lasso file as an ansi text file, the result is
wrong.
So I guess your source code file is not UTF-8, what editor are you using?

With kind regards,

Michael Coninx

Marc Pinnell wrote:

> Ok, so I created a brand new virgin page and C&P your code into it.
> This is what I get:
>
> Ca%E2%88%9A%C2%B1ada
> Cañada
> default.lasso?ma%E2%88%9A%C2%B1ana=tomorrow
> default.lasso?mañana=tomorrow
>
> Note the encoding of Cañada on the first line. Can you run the below
> and tell me what you get?
>
> <?lassoScript
> var: 'eName' = encode_url('Cañada');
> $eName+'<br />';
> decode_url($eName);
> '<br />';
> var: 'eName2' = encode_url('default.lasso?mañana=tomorrow');
> $eName2+'<br />';
> decode_url($eName2);
> ?>
>
> OUTPUT:
>
> Ca%E2%88%9A%C2%B1ada
> Cañada
> default.lasso?ma%E2%88%9A%C2%B1ana=tomorrow
> default.lasso?mañana=tomorrow
>
>
> Marc
>
>
> On Aug 1, 2007, at 11:03 PM, Steve Piercy - Web Site Builder wrote:
>
>> Did you copy and paste my source code exactly?
>>
>> When I copied and pasted your code into a file, I got the same
>> results that you experienced. I merely altered your code to use
>> [encode_url] instead of [encode_stricturl].
>>
>> --steve
>>
>>
>> On Wednesday, August 1, 2007, [hidden email] (Marc
>> Pinnell) pronounced:
>>
>>> Interesting. I am on 8.5.3b1 and if I understand what you are saying
>>> I am on UTF-8 as well.
>>>
>>> marc
>>>
>>>
>>> On Aug 1, 2007, at 4:47 PM, Steve Piercy - Web Site Builder wrote:
>>>
>>>> Strange. My code yielded the following results:
>>>>
>>>> Ca%C3%B1ada
>>>> Cañada
>>>> default.lasso?ma%C3%B1ana=tomorrow
>>>> default.lasso?mañana=tomorrow
>>>>
>>>> I use UTF-8 with BOM for file encoding and UTF-8 for character sets.
>>>>
>>>> Lasso 8.5.3.
>>>>
>>>> --steve
>>>>
>>>>
>>>> On Wednesday, August 1, 2007, [hidden email] (Marc
>>>> Pinnell) pronounced:
>>>>
>>>>> Doesn't help.
>>>>>
>>>>> On Aug 1, 2007, at 3:59 PM, Steve Piercy - Web Site Builder wrote:
>>>>>
>>>>>> Remove Strict, unless you need it for something else:
>>>>>>
>>>>>> <?lassoScript
>>>>>> encode_url('Cañada');
>>>>>> '<br />';
>>>>>> decode_url('Ca%C3%B1ada');
>>>>>> '<br />';
>>>>>> Encode_URL: 'default.lasso?mañana=tomorrow';
>>>>>> '<br />';
>>>>>> decode_url('default.lasso?ma%C3%B1ana=tomorrow');
>>>>>> ?>
>>>>>>
>>>>>> --steve
>>>>>>
>>>>>>
>>>>>> On Wednesday, August 1, 2007, [hidden email] (Marc
>>>>>> Pinnell) pronounced:
>>>>>>
>>>>>>> According to the LP reference online I should be able to encode
>>>>>>> the ñ
>>>>>>> character with the encode_strictURL and back without problem (it is
>>>>>>> actually the example given online). However, I can't seem to
>>>>>>> make it
>>>>>>> work - what am I doing wrong?
>>>>>>>
>>>>>>> <?lassoScript
>>>>>>> encode_Stricturl('Cañada');
>>>>>>> '<br />';
>>>>>>> decode_url('Ca%c3%92ada');
>>>>>>> '<br />';
>>>>>>> Encode_StrictURL: 'default.lasso?mañana=tomorrow';
>>>>>>> '<br />';
>>>>>>> decode_url('default.lasso%3fma%c3%92ana%3dtomorrow');
>>>>>>> ?>
>>>>>>>
>>>>>>> This code returns:
>>>>>>>
>>>>>>> Ca%c3%92ada
>>>>>>>
>>>>>>> CaÒada
>>>>>>>
>>>>>>> default.lasso%3fma%c3%92ana%3dtomorrow
>>>>>>>
>>>>>>> default.lasso?maÒana=tomorrow
>>>>>>>
>>>>>>> Thanx for any advice...
>>>>>>>
>>>>>>> Marc
>>>>>>
>>>>>> -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
>>>>>> Steve Piercy Web Site Builder Soquel, CA
>>>>>> <[hidden email]> <http://www.StevePiercy.com/>
>>>>>>
>>>>>> --
>>>>>> This list is a free service of LassoSoft: http://www.LassoSoft.com/
>>>>>> Search the list archives: http://www.ListSearch.com/Lasso/Browse/
>>>>>> Manage your subscription: http://www.ListSearch.com/Lasso/
>>>>>>
>>>>>
>>>>>
>>>>
>>>> -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
>>>> Steve Piercy Web Site Builder Soquel, CA
>>>> <[hidden email]> <http://www.StevePiercy.com/>
>>>>
>>>> --
>>>> This list is a free service of LassoSoft: http://www.LassoSoft.com/
>>>> Search the list archives: http://www.ListSearch.com/Lasso/Browse/
>>>> Manage your subscription: http://www.ListSearch.com/Lasso/
>>>>
>>>
>>>
>>
>> -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
>> Steve Piercy Web Site Builder Soquel, CA
>> <[hidden email]> <http://www.StevePiercy.com/>
>>
>> --
>> This list is a free service of LassoSoft: http://www.LassoSoft.com/
>> Search the list archives: http://www.ListSearch.com/Lasso/Browse/
>> Manage your subscription: http://www.ListSearch.com/Lasso/
>>
>
>


--
This list is a free service of LassoSoft: http://www.LassoSoft.com/
Search the list archives: http://www.ListSearch.com/Lasso/Browse/
Manage your subscription: http://www.ListSearch.com/Lasso/