Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
I've substituted my own string for yours and here's what I see now in the browser:
$VAR1 = "/search/\x{bf}Cuales son las partes de una cadena de conexi\x{f3}n??scope=SSGU8G_12.1.0|/|0|1|1|0\n";
UTF-8 flag is on

/search/¿Cuales son las partes de una cadena de conexión??scope=SSGU8G_12.1.0|/|0|1|1|0

After Text::CSV: /search/¿Cuales son las partes de una cadena de conexión??scope=SSGU8G_12.1.0 | /

\x{bf} or U+00BF is the inverted question mark and U+00F3 is “ó”, so AFAICT that looks correct, doesn't it?

BTW I'm assigning $data by reading a stdout output file that is returned from the db via the tool I'm using for the SQL query.

Ok, so do I understand correctly that you've tested the code you showed within the script I posted?

(BTW, why not use DBI to connect directly to the database instead of going through a file?)

I've also tried opening the file without the :encoding and get the same result.

Well, if you've got the use open qw/:std :utf8/; that I suggested at the top of the script, that also sets utf8 as the default encoding layer. As long as you're not getting warnings such as "Malformed UTF-8 character: \xbf" or "utf8 "\xBF" does not map to Unicode" (check the web server's error logs and/or run the script from the command line), then it would seem your file is probably encoded as UTF-8, and it would seem that everything is correct...

So are you still seeing the same problem as before, or is it working now?

In reply to Re^9: Text::CSV encoding parse() by haukex
in thread Text::CSV encoding parse() by slugger415

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

  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or or How to display code and escape characters are good places to start.
Log In?

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

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (4)
As of 2021-05-15 17:14 GMT
Find Nodes?
    Voting Booth?
    Perl 7 will be out ...

    Results (150 votes). Check out past polls.