<?xml version="1.0" encoding="windows-1252"?>
<node id="989688" title="Re^5: how to output file in Unicode" created="2012-08-25 00:13:45" updated="2012-08-25 00:13:45">
<type id="11">
note</type>
<author id="879250">
remiah</author>
<data>
<field name="doctext">
&lt;p&gt;
Here I suppose the LDAP module that returns last name, gives you "decoded utf8 string". What do you see in log.txt file? and any warning message?

&lt;code&gt;
my $lastname=''; #here put the return value of LDAP
open( my $fh, "&gt;:encoding(UTF-8)", "log.txt") or die $!;
print $fh utf8::is_utf8($lastname) ? 'utf8 flagged,' : 'not utf8 flagged,';
print $fh $lastname;
close $fh;
&lt;/code&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;pre&gt;
Some string (in this case LDAP)
 |
LDAP module?
 |        &lt;--- here LDAP returns what? is important information
perl
 |
utf8 text
&lt;/pre&gt;
Do you see the manual of LDAP module has 'encoding' or 'binmode' section for this information?
&lt;/p&gt;
</field>
<field name="root_node">
989377</field>
<field name="parent_node">
989629</field>
</data>
</node>
