Raised This Month: $32 Target: $400
 8% 

[APORTE] Caracteres especiales


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
MarLeo94
Junior Member
Join Date: Jul 2013
Location: Reino de Europa.
Old 08-17-2013 , 14:03   [APORTE] Caracteres especiales
Reply With Quote #1

Bueno espero que esto les sirva a mucha gente, un placer ayudar.

Code:
¡ -    ¿ - á - á   Á - à é - é   É - É í - Ã*   Í - à ó - ó   Ó - Ó ú - ú   Ú - Ú ñ - ñ   Ñ - Ñ

PD: Me faltan los dos primero, pero los pondré muy pronto, si se me paso algo solo hacedmelo saber.

PD2: Eso de los numeritos verdes nose porque salen, simplemente ignorelos.

PD3: Ya hay algo de esto creado por Kiske, pero solo están las letras en minúscula y le falta la "é, É".
__________________


Last edited by MarLeo94; 08-17-2013 at 14:08.
MarLeo94 is offline
chetah
Senior Member
Join Date: Jan 2013
Location: BangBros
Old 08-17-2013 , 14:07   Re: [APORTE] Caracteres especiales
Reply With Quote #2

mmm que esos numeros #8240; ?
__________________
Minecraft Mod: | %15
"Tomorrowland <3"
chetah is offline
MarLeo94
Junior Member
Join Date: Jul 2013
Location: Reino de Europa.
Old 08-17-2013 , 14:45   Re: [APORTE] Caracteres especiales
Reply With Quote #3

Quote:
Originally Posted by chetah View Post
mmm que esos numeros #8240; ?
En el "PD2" aclare que no sabia porque salían, porque yo no los puse ni nada...
__________________

MarLeo94 is offline
chetah
Senior Member
Join Date: Jan 2013
Location: BangBros
Old 08-17-2013 , 14:50   Re: [APORTE] Caracteres especiales
Reply With Quote #4

Ah lol que despues pusiste el edit
__________________
Minecraft Mod: | %15
"Tomorrowland <3"
chetah is offline
Roccoxx
AlliedModders Donor
Join Date: Jan 2012
Location: Argentina
Old 08-17-2013 , 15:50   Re: [APORTE] Caracteres especiales
Reply With Quote #5

ya habia un post de kiske sobre esto.
__________________
Tutorials here (Spanish)

Like as another Pijudo said: "Tired and retired"
Roccoxx is offline
Send a message via MSN to Roccoxx
chetah
Senior Member
Join Date: Jan 2013
Location: BangBros
Old 08-17-2013 , 15:56   Re: [APORTE] Caracteres especiales
Reply With Quote #6

Quote:
Originally Posted by MarLeo94
PD3: Ya hay algo de esto creado por Kiske, pero solo están las letras en minúscula y le falta la "é, É".
__________________
Minecraft Mod: | %15
"Tomorrowland <3"
chetah is offline
Roccoxx
AlliedModders Donor
Join Date: Jan 2012
Location: Argentina
Old 08-17-2013 , 17:44   Re: [APORTE] Caracteres especiales
Reply With Quote #7

gracias chetah no lo habia visto, pido disculpas al creador del tema.

aca dejo un stock posteado por gonza (Pro) con todo incluido.

PHP Code:
stock ReemplazarTildes(szText[]=""len=0)
{
    
replace_all(szTextlen"á""á")
    
replace_all(szTextlen"Á""Ã")
    
replace_all(szTextlen"é""é")
    
replace_all(szTextlen"É""É")
    
replace_all(szTextlen"í""Ã*")
    
replace_all(szTextlen"Í""Ã")
    
replace_all(szTextlen"ó""ó")
    
replace_all(szTextlen"Ó""Ó")
    
replace_all(szTextlen"ú""ú")
    
replace_all(szTextlen"Ú""Ú")
    
replace_all(szTextlen"ñ""ñ")
    
replace_all(szTextlen"Ñ""Ñ")
    
    static 
szReturn[1024]; formatex(szReturn1023szText)
    
    return 
szReturn

__________________
Tutorials here (Spanish)

Like as another Pijudo said: "Tired and retired"
Roccoxx is offline
Send a message via MSN to Roccoxx
DiegoCS
Senior Member
Join Date: Mar 2013
Old 08-17-2013 , 17:49   Re: [APORTE] Caracteres especiales
Reply With Quote #8

Quote:
Originally Posted by Roccoxx View Post
gracias chetah no lo habia visto, pido disculpas al creador del tema.

aca dejo un stock posteado por gonza (Pro) con todo incluido.

PHP Code:
stock ReemplazarTildes(szText[]=""len=0)
{
    
replace_all(szTextlen"á""á")
    
replace_all(szTextlen"Á""Ã")
    
replace_all(szTextlen"é""é")
    
replace_all(szTextlen"É""É")
    
replace_all(szTextlen"í""Ã*")
    
replace_all(szTextlen"Í""Ã")
    
replace_all(szTextlen"ó""ó")
    
replace_all(szTextlen"Ó""Ó")
    
replace_all(szTextlen"ú""ú")
    
replace_all(szTextlen"Ú""Ú")
    
replace_all(szTextlen"ñ""ñ")
    
replace_all(szTextlen"Ñ""Ñ")
    
    static 
szReturn[1024]; formatex(szReturn1023szText)
    
    return 
szReturn

piola.. si yo pongo en un formatex , "ñ" sale la ñ no ?
DiegoCS is offline
meTaLiCroSS
Gaze Upon My Hat
Join Date: Feb 2009
Location: Viña del Mar, Chile
Old 08-17-2013 , 19:25   Re: [APORTE] Caracteres especiales
Reply With Quote #9

Quote:
Originally Posted by Roccoxx View Post
gracias chetah no lo habia visto, pido disculpas al creador del tema.

aca dejo un stock posteado por gonza (Pro) con todo incluido.

PHP Code:
stock ReemplazarTildes(szText[]=""len=0)
{
    
replace_all(szTextlen"á""á")
    
replace_all(szTextlen"Á""Ã")
    
replace_all(szTextlen"é""é")
    
replace_all(szTextlen"É""É")
    
replace_all(szTextlen"í""Ã*")
    
replace_all(szTextlen"Í""Ã")
    
replace_all(szTextlen"ó""ó")
    
replace_all(szTextlen"Ó""Ó")
    
replace_all(szTextlen"ú""ú")
    
replace_all(szTextlen"Ú""Ú")
    
replace_all(szTextlen"ñ""ñ")
    
replace_all(szTextlen"Ñ""Ñ")
    
    static 
szReturn[1024]; formatex(szReturn1023szText)
    
    return 
szReturn

Detalle, para los que no sabian, replace_all es un stock

PHP Code:
/* Replaces a contained string iteratively.
 * This ensures that no infinite replacements will take place by
 *  intelligently moving to the next string position each iteration.
 */
stock replace_all(string[], len, const what[], const with[])
{
    new 
pos 0;
    
    if ((
pos contain(stringwhat)) == -1)
    {
        return 
0;
    }
    
    new 
total 0;
    new 
with_len strlen(with);
    new 
diff strlen(what) - with_len;
    new 
total_len strlen(string);
    new 
temp_pos 0;
    
    while (
replace(string[pos], len poswhatwith) != 0)
    {
        
/* jump to position after replacement */
        
pos += with_len;
        
        
/* update cached length of string */
        
total_len -= diff;
        
        
/* will the next call be operating on the last character? */
        
if (pos >= total_len)
        {
            break;
        }
        
        
/* find the next position from our offset */
        
temp_pos contain(string[pos], what);
        
        
/* if it's invalid, we're done */
        
if (temp_pos == -1)
        {
            break;
        }
        
        
/* otherwise, reposition and update counters */
        
pos += temp_pos;
        
total++;
    }
    
    return 
total;

Repite esa operacion 12 veces y saca calculos...
__________________
Quote:
Originally Posted by joropito View Post
You're right Metalicross
meTaLiCroSS is offline
DiegoCS
Senior Member
Join Date: Mar 2013
Old 08-17-2013 , 22:07   Re: [APORTE] Caracteres especiales
Reply With Quote #10

ya sabía lo de replace_all , yo lo usó para SQL Injection y otras cosas.

EDIT: Probé lo que posteo roccoxx (de _Pro_) y ya no tengo dudas .
DiegoCS is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 16:54.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode