[freeside] International Characters -- Error: Illegal (text) (error code illegal_text) state: M?laga

Karl Hiramoto karl at hiramoto.org
Sun Jan 23 15:20:50 PST 2005


Hi Ivan and all,

I have a fix for this problem I have been having with some characters used in Spanish names and addresses frequently.  I had to dig up the manual on regular expressions though. :-)  I would like to know if this can be  incorporated in future versions?


I had to change all the locations that can return illegal_text or illegal_or_empty_text  =

need a sight mod to the regex

I added \á\é\í\ó\ú\ñ\Á\É\Í\Ó\Ú\Ñ\

for example in FS/FS/Record.pm

sub ut_textn {
  my($self,$field)=@_;
  $self->getfield($field) =~ /^([\w \!\@\#\$\%\&\(\)\-\+\;\:\'\"\,\.\?\/\á\é\í\ó\ú\ñ\Á\É\Í\Ó\Ú\Ñ\=]*)$/
    or return gettext('illegal_text'). " $field: ". $self->getfield($field);
  $self->setfield($field,$1);
  '';
}


Perhaps though it would be better to use the hex codes, or a hex range. Take a look at the Record.pm where i changed the ut_text() and ut_textn().

Also I was wondering if there was something on CPAN to do this..   



---
Karl Hiramoto <karl at hiramoto.org>



Karl Hiramoto wrote:

> Hello again,
> I´m still having problems with international characters.  I tried 
> setting LANG=C
>
> host root # env |grep LANG
> LANG=C
> host root # /etc/init.d/apache restart
> * Stopping 
> apache...                                                                                                                           
> [ ok ]
> * Starting apache...  
> In the apache configuration I placed
> SetEnv LANG C
>
> I also was able to reproduce the same error on the webdemo.   And took 
> a screenshot:
> http://karl.hiramoto.org/temp/freeside-malaga.gif
>
> URL of test:
> http://webdemo.sisd.com:82/edit/cust_main.cgi?custnum=1;agentnum=1;refnum=1;referral_custnum=;last=Kohler;first=Ivan;ss=;company=Freeside;address1=1234%20Test%20Lane;address2=;city=Truckee;county=;state=M%E1laga;zip=96161;country=ES;daytime=415-462-1624;night=;fax=;invoicing_list_POST=POST;invoicing_list=POST;CARD_payinfo=;CARD_month=1;CARD_year=2005;CARD_payname=;CARD_paycvv=;DCRD_payinfo=;DCRD_month=1;DCRD_year=2005;DCRD_payname=;DCRD_paycvv=;CHEK_payinfo1=;CHEK_payinfo2=;CHEK_month=12;CHEK_year=2037;CHEK_payname=;DCHK_payinfo1=;DCHK_payinfo2=;DCHK_month=12;DCHK_year=2037;DCHK_payname=;LECB_month=12;LECB_year=2037;LECB_payname=;payby=BILL;BILL_payinfo=54;BILL_month=12;BILL_year=2037;BILL_payname=Ivan%20Kohler;COMP_payinfo=;COMP_month=1;COMP_year=2005;comments=;otaker=guest;tax=;payinfo=54;paydate=12-2037;payname=Ivan%20Kohler;error=Illegal%20%28text%29%20%28error%20code%20illegal_text%29%20state%3A%20M%E1laga 
>
>
> the offending character in this case is hex code 0xE1  and there are 
> some other characters I need as well.  
> The other error I have is:  Error: Unknown state/county/country: A//ES
> Here is another screen shot of the problem:
> http://karl.hiramoto.org/temp/freeside-coruna.gif
>
>
>
> ivan wrote:
>
>> try making sure LANG="C" when Apache is started.  There is not 
>> currently an internationalization framework.
>>                       
>>
>
> On Sun, Jan 02, 2005 at 11:23:01PM +0100, Karl Hiramoto wrote:
>
>>> In the country ES (Spain) there is the province of M?laga
>>> i get the error of:
>>> Error: Illegal (text) (error code illegal_text) state: M?laga
>>> I believe the "?" character is causing the server to error.
>>>
>>> If i change to a state/region that does not have the character, it 
>>> works fine.  URL of error 
>>> http://server//masondocs/edit/cust_main.cgi?custnum=1;agentnum=1;refnum=2;referral_custnum=;last=test;first=user;ss=;company=;address1=None;address2=;city=Malaga;state=M%E1laga;zip=29600;country=ES;daytime=;night=;fax=;invoicing_list_POST=POST;invoicing_list=POST;CARD_payinfo=;CARD_month=1;CARD_year=2005;CARD_payname=;CARD_paycvv=;DCRD_payinfo=;DCRD_month=1;DCRD_year=2005;DCRD_payname=;DCRD_paycvv=;CHEK_payinfo1=;CHEK_payinfo2=;CHEK_month=12;CHEK_year=2037;CHEK_payname=;DCHK_payinfo1=;DCHK_payinfo2=;DCHK_month=12;DCHK_year=2037;DCHK_payname=;LECB_month=12;LECB_year=2037;LECB_payname=;BILL_payinfo=;BILL_month=12;BILL_year=2037;BILL_payname=;payby=COMP;COMP_payinfo=Karl;COMP_month=1;COMP_year=2005;comments=;otaker=karl;tax=;payinfo=Karl;paydate=1-2005;error=Illegal%20%28text%29%20%28error%20code%20illegal_text%29%20state%3A%20M%E1laga 
>>>
>>>
>>> I just installed today using HTML::Mason on gentoo linux with apache 
>>> 1.3.33 and postgresql backend. All installed all the perl modules 
>>> today from CPAN so they would be the latest version.  
>>> freeside-1.5.0pre6
>>>
>>>
>>> On another question how much internationalization is there?   For 
>>> example since I?m in Spain if there was a way to configure multiple 
>>> languages available for customers to use the self signup it would be 
>>> nice..  I?m willing to do some translation help if necessary.
>>>
>>> What I had in mind was on the self signup the users could select 
>>> between  English, Spanish (Espa?ol) or German(Deutsch) for example.
>>>
>>>
>>> -- 
>>>
>>> ---
>>> Karl Hiramoto <karl at hiramoto.org>
>>> US VOIP: 603.966.4448
>>> Spain Home from US 011(34) 952.827.554
>>> Spain Home from EU 00 (34) 952.827.554
>>> Spain Mobil 011 (34) 617.463.826
>>> Yahoo_IM = karl_hiramoto   jabber.org=karl_hiramoto
>>> ------
>>> -
>>> You know you're using the computer too much when:
>>> you are unable to sleep without its comforting whirring sound.
>>>     -- neenee
>>
>>
>
>

-------------- next part --------------
A non-text attachment was scrubbed...
Name: Record.pm
Type: application/x-perl
Size: 45922 bytes
Desc: not available
Url : http://420.am/pipermail/freeside-users/attachments/20050123/cb42c913/Record.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: karl.vcf
Type: text/x-vcard
Size: 101 bytes
Desc: not available
Url : http://420.am/pipermail/freeside-users/attachments/20050123/cb42c913/karl.vcf


More information about the freeside-users mailing list