Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Converting foreign accents
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Visual FoxExpress
Divers
Thread ID:
01648083
Message ID:
01648174
Vues:
51
>
>*!*chrtran() vfp function replaces each character in a character expression that matches a character in a 
>*!*	second character expression   with the corresponding character in a third character expression.
>*!*syntaxe: CHRTRAN(cSearchedExpression, cSearchExpression, cReplacementExpression)
>*!*	 
>
>local m.myvar
>text to m.myvar noshow  &&this is a french text with acents,^,...specific chars (from http://www.lorem-accents.com/)
>Tellus donec pulvîar fancibüs à classé pésuéré arcu mattis, aliquét alèquam habitant juséo convallis tùrpus néc, 
>adipiscing enim !
>énis nostra fuscé. Fringlilia vestibulum sed famès nostré morbi mattis ut, cubliâ classé curae metus conubia 
>cél litoré, primis donéc dictum aliquet pulvîar et orci interdum.
>endtext
>messagebox(m.myvar,0+32+4096,"first string version")
>local mynewVar
>m.myNewvar=CHRTRAN(m.myvar, "ÀÁÂÃÄÅÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖÙÚÛÜÝàáâãäåçèéêëìíîïðñòóôõöùúûüýÿ","AAAAAACEEEEIIIIDNOOOOOUUUUYaaaaaaceeeeiiiidnooooouuuuyy")
>
>messagebox(m.myNewvar,0+32+4096,"in clipboard")  &&can paste anywhere from the clipboard and see there is no specific french letters
>
I have German anf d French names in column i of my database - I pass this field to a variable call addfield and then replace i with the result of the chrtran but nothing gets changed - the accents are still there - what am I doing wrong?

My code is

local m.mynewVar
SELECT globalinx
SCAN
STORE i TO addfield
m.mynewVar=CHRTRAN(addfield, "ÀÁÂÃÄÅÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖÙÚÛÜÝàáâãäåçèéêëìíîïðñòóôõöùúûüýÿ","AAAAAACEEEEIIIIDNOOOOOUUUUYaaaaaaceeeeiiiidnooooouuuuyy")
replace i WITH m.mynewVar
endscan
Specialist in Advertising, Marketing, especially Direct Marketing

I run courses in Business Management and Marketing
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform