Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re^2: Handling special characters in JSON (TFM)

by ysth (Canon)
on Dec 16, 2010 at 03:47 UTC ( #877431=note: print w/replies, xml ) Need Help??


in reply to Re: Handling special characters in JSON (TFM)
in thread Handling special characters in JSON

That assumes a perl data structure as the source, which wasn't clearly (to me) the case. Anyway, I do:
JSON::to_json( ["\x{00e9}"], { 'ascii' => 1 } )
(with JSON using JSON::XS).
--
A math joke: r = | |csc(θ)|+|sec(θ)|-||csc(θ)|-|sec(θ)|| |
Online Fortune Cookie Search
Office Space merchandise

Replies are listed 'Best First'.
Re^3: Handling special characters in JSON (TFM)
by tye (Sage) on Dec 16, 2010 at 04:35 UTC
    That assumes a perl data structure as the source, which wasn't clearly (to me) the case.

    Oh. Well, if only there was a way to take JSON and turn it into a Perl data structure... q-:

    But "I wrote an ajax service in perl" sure sounds to me like something that is likely to be generating JSON from Perl data structures. :)

    - tye        

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://877431]
help
Chatterbox?
[erix]: the annoying thing is that during setup of the 'foreign table' you have to specify all the columns. But that is reasonably automatable (just reading header line, and contruct the needed CREATE FOREIGN TABLE' statement)
[erix]: it may be easier to just slurp your fils into regular tables. Has other infrastructure advantages also (indexes, constraints etc)

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (9)
As of 2018-02-23 15:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    When it is dark outside I am happiest to see ...














    Results (302 votes). Check out past polls.

    Notices?