-1

This is in reference to this topic on the page here:

Converting punycode with dash character to Unicode

//Javascript Punycode converter derived from example in RFC3492.

I don't know where to place the input 清华大学.cn domain to get the Javascript to work. I am not a real a programmer.

I want to use the js code on this page to convert IDN domain names to penycode if possible. I'm using a ColdFusion html page to process the JS. Then I'll save the penycode to our SQL database.

Example: 清华大学.cn needs to be converted to penycode.

I can use any number of online converters but that won't help. It has to be automated with a script. FYI, the penycode for 清华大学.cn is xn--xkry9kk1bz66a.cn.

HERE IS MY PROBLEM: Even after copying the js code into Dreamweaver, I have no idea where to place the domain 清华大学.cn into the Javascript code be converted. I can't see a hint where the input is - if any. I can figure things out okay if there was some hint at where to begin.

I just need to know where to place the input or someone to tell me this can't be done with the Javascript example on that page.

We are using ColdFusion 19 and SQL on our under construction domain marketplace website. We want to accept IDN domains to be listed and I am hoping your JS will do what I want.

If I'm totally wrong then perhaps someone can suggest another js code that will convert the domain to correct penycode.

1 Answers1

0

After searching I found an close answer I can at least work with, I hope. I needed an html input form to process the Javascript.

I found that information here.

How to convert domain names with greek characters to an ascii URL?

I then copied the page, inserted the Javascript as puny.js and it works. Now I need to figure out how to somehow capture the input "id" and "label for" to save the result into SQL using ColdFusion. Not sure if this can be done. But at least the somewhat answers my question. Maybe it's the best I'm going to get here on Stackoverflow.

  • "Maybe it's the best I'm going to get here on Stackoverflow." Note that this website is about helping existing code and fix problems, not a "please do the job for me" type of site. You unfortunately do not share piece of code and even seem to imply you don't want to program, saying "I am not a real a programmer.". Your title does not map exactly to the content, you mispell punycode twice, you add tags irrelevant to the question like `dns` or `ascii`, etc. All of that makes it hard to really help you on this website. – Patrick Mevzek Nov 17 '22 at 19:46