chars on url variables

MiServer is Dyalog's APL-based web development framework

chars on url variables

Postby Gantois on Sat Nov 05, 2016 8:42 am

URL variables

Some chars are not recognized after passed as variables value on URL. How could I solve this?

example:
req.Meta'http-equiv="refresh" content="0;URL=/',('indexCad.dyalog?acao=BemVindo&login=',login,'&userid=',userid),'"'

login before: Conceição
login after: Conceição

Thanks,
Marco
Gantois
 
Posts: 90
Joined: Thu Apr 17, 2014 9:44 am

Re: chars on url variables

Postby Morten|Dyalog on Sat Nov 05, 2016 9:08 am

Looks like the data is UTF-8 encoded. I'm a little surprised MiServer has not taken care of this for you, but will leave that for Brian to respond to. Dyadic ⎕UCS can convert to and from a variety of Unicode encodings. If the right argument is text, you will get a numeric result containing encoded data, and if you pass a numeric vector containing the encoded bytes, you will get decoded text.

So to convert characters which represent UTF-8 encoded data, you need to use ⎕UCS twice, first monadically to convert your text into numeric values, and the dyadically to give you the decoded text:

Code: Select all
      'UTF-8' ⎕UCS ⎕UCS'Conceição'
Conceição
User avatar
Morten|Dyalog
 
Posts: 460
Joined: Tue Sep 09, 2008 3:52 pm

Re: chars on url variables

Postby Gantois on Sat Nov 05, 2016 8:04 pm

ok,
Thanks
Marco
Gantois
 
Posts: 90
Joined: Thu Apr 17, 2014 9:44 am


Return to MiServer

Who is online

Users browsing this forum: No registered users and 1 guest