Comparison

util-src/encodings.c @ 2850:3f646804ed6a

util.encodings: Use STD3 ASCII rules for idna.to_ascii.
author Waqas Hussain <waqas20@gmail.com>
date Wed, 10 Feb 2010 00:12:48 +0500
parent 1860:5ef1eea887ca
child 2923:b7049746bd29
comparison
equal deleted inserted replaced
2849:c940726e787e 2850:3f646804ed6a
172 static int Lidna_to_ascii(lua_State *L) /** idna.to_ascii(s) */ 172 static int Lidna_to_ascii(lua_State *L) /** idna.to_ascii(s) */
173 { 173 {
174 size_t len; 174 size_t len;
175 const char *s = luaL_checklstring(L, 1, &len); 175 const char *s = luaL_checklstring(L, 1, &len);
176 char* output = NULL; 176 char* output = NULL;
177 int ret = idna_to_ascii_8z(s, &output, 0); 177 int ret = idna_to_ascii_8z(s, &output, IDNA_USE_STD3_ASCII_RULES);
178 if (ret == IDNA_SUCCESS) { 178 if (ret == IDNA_SUCCESS) {
179 lua_pushstring(L, output); 179 lua_pushstring(L, output);
180 idn_free(output); 180 idn_free(output);
181 return 1; 181 return 1;
182 } else { 182 } else {