The gethostname and sethostname calls take a char* as first argument. Does either of these functions support non-ASCII characters?
Hostnames and Internet style domain names must stay in the subset of 7-bit ASCII as specified in RFC952, 1035, 1122, and 1123. http://www.ietf.org/rfc/rfc952.txt. If you though wish to support non-ASCII characters at the host or domain names with your program, you can use IDN conversion functions such as idn_encodename(3EXT), idn_decodename(3EXT) to convert between non-ASCII names and ACE (ASCII Compatible Encoding) names and use the ACE names at the system files, networking interfaces, and so on where the 7-bit ASCII names are required. In other words, your application is required to do the conversions between non-ASCII names and ACE names before using the ACE names at the various places where host and domain names are used in the system. (Of course, users would expect to see non-ASCII names when they are dealing with your program and so this conversion should be supported transparently by your program.) For more details, please see the idn_encodename(3EXT) man page at S9 Update 6 or
Related Questions
- The gethostname and sethostname calls take a char* as first argument. Does either of these functions support non-ASCII characters?
- It seems that double byte (Chinese-traditional words) cannot be shown exactly. Does JReport support Chinese characters?
- Do either the gethostname and sethostname functions support non-ASCII characters?