Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Comment on

( #3333=superdoc: print w/ replies, xml ) Need Help??

I'm writing a script which generates JSON code based on an arrayref result from a DBI query. To cover issues with special characters (quotes, slashes, etc.) I "escape" them with a library subroutine changing space to %20, etc. (similar to javascript's escape() function) thus I can unescape them with my getJSON ajaxed javascript library function to get back the original data.

All data is ASCII, data fields being encoded can be alpha-numeric primary key type identifiers (like model numbers, serial numbers, etc.)

I am getting "wide character in print" messages when I run this script. There is no wide character in the data--database character encoding is restricted to ASCII. The only thing I can think is somehow I've munged the data to have ascii wide-character representation or one of these key type identifiers coincidentally has ascii wide-character representation.

The only such representation I know of involves backslashes and possibly curly brackets. Is there another representation I could have stumbled across unkowingly?

Here is a block of the ascii data which seems to trigger the message:

{"rpt_hdrrow" : "N", "program_id" : "SCIA410A", "rpt_skiplines" : "N", "gph_numcols" : "%20", "gph_keycols" : "%20", "display_name" : "Daily%20Stock%20In-Out%20Activity%20History", "rpt_rowtot" : "N", "rpt_formatno" : "4", "rpt_oldpvts" : "N", "rpt_nograndtl" : "N", "rpt_pagelines" : "45", "gph_type" : "%20%20%20%20", "rpt_nozeros" : "N", "gph_scaletype" : "%20%20%20%20"} {"rpt_hdrrow" : "N", "program_id" : "SCIA410H", "rpt_skiplines" : "N", "gph_numcols" : "", "gph_keycols" : "", "display_name" : "Daily%20IWide character in print at rds200wt.pl line + 2366, <CFG_FILE> line 32.nventory%20Detail%20List", "rpt_rowtot" : "N", "rpt_formatno" : "4", "rpt_oldpvts" : "N", "rpt_nograndtl" : "N", "rpt_pagelines" : "45", "gph_type" : "%20%20%20%20", "rpt_nozeros" : "N", "gph_scaletype" : "%20%20%20%20"}

In reply to Wide Character in Print Warning by nmork

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • Outside of code tags, you may need to use entities for some characters:
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others exploiting the Monastery: (6)
    As of 2014-10-25 22:47 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      For retirement, I am banking on:










      Results (149 votes), past polls