dash2 has asked for the wisdom of the Perl Monks concerning the following question:

Okay, this has baffled me. I am trying to write a script to search for multilingual domain names, and this requires that I read Chinese characters input into a browser. Micro$oft tends to encode these using &#NUMBER where NUMBER. is the unicode number of the chinese character. I know how to convert this from Unicode to GB encoding (it involves a very large hash) but I don't know how to encode the resulting number into a GB string. E.g., if I have some hex GB numbers (0x77FE 0x44DF etc.) how do I convert these into a GB string (using GB2312-80) to send over the internet ?
foolish newbie earnestly requests help.
Dave

btw: apologies for the ugly formatting. I am viewing in Konqueror which for some reason prints the TEXTAREA as a very narrow strip.

Replies are listed 'Best First'.
Re: encoding from Unicode to GB
by clemburg (Curate) on Nov 28, 2000 at 18:06 UTC
Re: encoding from Unicode to GB
by lhoward (Vicar) on Nov 28, 2000 at 18:20 UTC
      Thanks for the useful hints. Some references would be great. It would also be nice if someone could explain to me how one goes about encoding strings as bytes for sending over the net - a high-level description would be good, because I really feel rather blind in this area.
Re: encoding from Unicode to GB
by snax (Hermit) on Nov 28, 2000 at 17:58 UTC
    Once you're in unicode you can use the Unicode modules. They're very nice. Check CPAN for Unicode.