nmork has asked for the wisdom of the Perl Monks concerning the following question:
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"}
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Wide Character in Print Warning
by moritz (Cardinal) on Oct 09, 2012 at 15:39 UTC | |
|
Re: Wide Character in Print Warning
by daxim (Curate) on Oct 09, 2012 at 15:30 UTC |