tags:

views:

81

answers:

1

how convert string into Unicode string in Perl.

I am looking some attribute in LDAP which accepts only Unicode string .

So i want to convert normal string to Unicode string

+1  A: 

If you're using Perl 5.8.0 or newer, Perl strings are Unicode strings. If you have a string in some other encoding, look at the Encode module and the :encoding layer. You can get a list of the supported encodings in your Perl with perldoc Encode::Supported.

Edit:

How are you accessing the LDAP server? If you're using Net::LDAP, then you probably want to use the raw => REGEX option. Any LDAP attribute that matches REGEX is treated as a binary string. All other attributes get handled as Unicode strings.

cjm