Internationalization and localization tools


Locale-Sensitive JavaScript NodeJS Method

punycode.encode(string);
punycode.decode(string);

Internationalization (I18n) Method Overview

Punycode is an encoding style designed to convey unicode information through ascii text (see RFC 3492). Host name URL's are limited to ascii, so punycode is used by browsers to include unicode characters in urls. The punycode methods listed above can encode and decode this information.

Click here for additional details.

I18n Issues

punycode.encode and punycode.decode work with UCS2 strings. UCS2 cannot properly display code points outside the Basic Multilingual Plane. These code points, which are represented by 2 16bit surrogate pairs, are instead treated as if they were 2 16bit code points.

Suggested Replacement

Use punycode.ucs2.encode and punycode.ucs2.decode instead of punycode.encode and punycode.decode. These return arrays of the numeric codepoint values for each unicode symbol of the string.

Globalyzer will detect this method and report it as an i18n issue. If you have determined that the call is being handled correctly, you can use Globalyzer's Ignore Comment functionality to ensure that it isn't picked up in a subsequent scan.



Locale-Sensitive JavaScript Methods

 

Lingoport internationalization and localization services and software