Handling of international domain names. More...
#include <stdbool.h>
#include <stdint.h>
Go to the source code of this file.
Macros | |
#define | MI_NO_FLAGS 0 |
#define | MI_MAY_BE_IRREVERSIBLE (1 << 0) |
Functions | |
char * | mutt_idna_intl_to_local (const char *user, const char *domain, uint8_t flags) |
Convert an email's domain from Punycode. | |
char * | mutt_idna_local_to_intl (const char *user, const char *domain) |
Convert an email's domain to Punycode. | |
const char * | mutt_idna_print_version (void) |
Create an IDN version string. | |
int | mutt_idna_to_ascii_lz (const char *input, char **output, uint8_t flags) |
Convert a domain to Punycode. | |
Handling of international domain names.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.
Definition in file idna2.h.
char * mutt_idna_intl_to_local | ( | const char * | user, |
const char * | domain, | ||
uint8_t | flags | ||
) |
Convert an email's domain from Punycode.
user | Username |
domain | Domain |
flags | Flags, e.g. MI_MAY_BE_IRREVERSIBLE |
ptr | Newly allocated local email address |
NULL | Error in conversion |
If $idn_decode
is set, then the domain will be converted from Punycode. For example, "xn--ls8h.la" becomes the emoji domain: ":poop:.la" Then the user and domain are changed from 'utf-8' to the encoding in $charset
.
If the flag MI_MAY_BE_IRREVERSIBLE is NOT given, then the results will be checked to make sure that the transformation is "undo-able".
Definition at line 117 of file idna.c.
char * mutt_idna_local_to_intl | ( | const char * | user, |
const char * | domain | ||
) |
Convert an email's domain to Punycode.
user | Username |
domain | Domain |
ptr | Newly allocated Punycode email address |
NULL | Error in conversion |
The user and domain are assumed to be encoded according to $charset
. They are converted to 'utf-8'. If $idn_encode
is set, then the domain will be converted to Punycode. For example, the emoji domain: ":poop:.la" becomes "xn--ls8h.la"
Definition at line 227 of file idna.c.
const char * mutt_idna_print_version | ( | void | ) |
Create an IDN version string.
ptr | Version string |
Definition at line 272 of file idna.c.
int mutt_idna_to_ascii_lz | ( | const char * | input, |
char ** | output, | ||
uint8_t | flags | ||
) |
Convert a domain to Punycode.
[in] | input | Domain |
[out] | output | Result |
[in] | flags | Flags, e.g. IDNA_ALLOW_UNASSIGNED |
0 | Success |
>0 | Failure, error code |
Convert a domain from the current locale to Punycode.
Definition at line 90 of file idna.c.