Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: Encoding horridness

by runrig (Abbot)
on Jul 12, 2017 at 17:58 UTC ( #1194959=note: print w/replies, xml ) Need Help??


in reply to Encoding horridness

You don't mention, but you have successfully parsed the file that you're generating with XML::LibXML, right?

Replies are listed 'Best First'.
Re^2: Encoding horridness
by jfrm (Monk) on Jul 16, 2017 at 09:02 UTC
    No, I haven't but based on your suggestion and on others comments (thanks to all), I will now do that. Incidentally, to answer questions from others, some of the data in the file is coming from a mySQL database and having checked some of the fields are in UTF and some are latin1 so maybe that is the problem (although I believe you are right - my service provider should give more feedback and I am going to badger them to do this). Other values are just coming from the script itself. I read that PERL internally uses UTF-8 format. So doesn't that mean that all data values unless sourced direct from the database are UTF-8 and therefore my latin1 encoded XML should never have worked? Or is it just that I was probably lucky as latin1 is 'almost' a subset of UTF-8?
      I read that PERL internally uses UTF-8 format.

      Where did you read that? Certainly not from perlunitut which says (my emphasis):

      Perl has an internal format, an encoding that it uses to encode text strings so it can store them in memory. All text strings are in this internal format. In fact, text strings are never in any other format!

      You shouldn't worry about what this format is, because conversion is automatically done when you decode or encode.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1194959]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (3)
As of 2019-04-21 02:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I am most likely to install a new module from CPAN if:
















    Results (110 votes). Check out past polls.

    Notices?
    • (Sep 10, 2018 at 22:53 UTC) Welcome new users!