开发者

How can I convert a string into unicode string in Perl

开发者 https://www.devze.com 2023-01-04 04:53 出处:网络
how convert string into Unicode string in Perl. I am looking some attribute in LDAP which开发者_Go百科 accepts only Unicode string .

how convert string into Unicode string in Perl.

I am looking some attribute in LDAP which开发者_Go百科 accepts only Unicode string .

So i want to convert normal string to Unicode string


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消