X = "Papeterie" X = X.replace(/&#(xd+);/g, function (a, b) { return String.fromCharCode("0"+b) } ) // donne "Papeterie"
Voyez aussi <URL:http://www.merlyn.demon.co.uk/js-other.htm#Safe>, pour les *decimals*
<span ID=UnCo></span> <!-- Espace de travail -->
function Wryt(ID, S) { document.getElementById(ID).innerHTML = S }
function Dec(S) { Wryt('UnCo', S) ; S = UnCo.innerText Wryt('UnCo', "") ; return S }
X = "Papeterie"
X = X.replace(/&#(xd+);/g, function (a, b)
{ return String.fromCharCode("0"+b) } ) // donne "Papeterie"
Voyez aussi <URL:http://www.merlyn.demon.co.uk/js-other.htm#Safe>, pour
les *decimals*
<span ID=UnCo></span> <!-- Espace de travail -->
function Wryt(ID, S) { document.getElementById(ID).innerHTML = S }
function Dec(S) { Wryt('UnCo', S) ; S = UnCo.innerText
Wryt('UnCo', "") ; return S }
X = "Papeterie" X = X.replace(/&#(xd+);/g, function (a, b) { return String.fromCharCode("0"+b) } ) // donne "Papeterie"
Voyez aussi <URL:http://www.merlyn.demon.co.uk/js-other.htm#Safe>, pour les *decimals*
<span ID=UnCo></span> <!-- Espace de travail -->
function Wryt(ID, S) { document.getElementById(ID).innerHTML = S }
function Dec(S) { Wryt('UnCo', S) ; S = UnCo.innerText Wryt('UnCo', "") ; return S }
X = "Papeterie" X = X.replace(/&#(xd+);/g, function (a, b) { return String.fromCharCode("0"+b) } ) // donne "Papeterie"
[lang=fr] J'avais complètement oublié la méthode fromCharCode; votre idée est élégante, John, mais la regexp n'est pas correcte, comme expliqué par Olivier, les nombres hexadécimaux comportent également des [a-f]; par ailleurs, un indicateur ignore-case rendrait le tout plus robuste. [/lang]
[lang=en] I had completely forgotten about the fromCharCode method, good insight John, however the regexp isn't correct, as explained by Olivier, hex numbers are also composed of [a-f]; an ignore-case flag would also be safer. [/lang]
X.replace(/&#(x[0-9a-f]+);/gi, function (a, b) { return String.fromCharCode("0"+b) } )
Vide Infra.
I've just done that, and my girlfriend just slapped me... :$
Cheers, Elegie.
Dr J R Stockton wrote:
Hello John,
X = "Papeterie"
X = X.replace(/&#(xd+);/g, function (a, b)
{ return String.fromCharCode("0"+b) } ) // donne "Papeterie"
[lang=fr]
J'avais complètement oublié la méthode fromCharCode; votre idée est
élégante, John, mais la regexp n'est pas correcte, comme expliqué par
Olivier, les nombres hexadécimaux comportent également des [a-f]; par
ailleurs, un indicateur ignore-case rendrait le tout plus robuste.
[/lang]
[lang=en]
I had completely forgotten about the fromCharCode method, good insight
John, however the regexp isn't correct, as explained by Olivier, hex
numbers are also composed of [a-f]; an ignore-case flag would also be safer.
[/lang]
X.replace(/&#(x[0-9a-f]+);/gi, function (a, b)
{ return String.fromCharCode("0"+b) } )
Vide Infra.
I've just done that, and my girlfriend just slapped me... :$
X = "Papeterie" X = X.replace(/&#(xd+);/g, function (a, b) { return String.fromCharCode("0"+b) } ) // donne "Papeterie"
[lang=fr] J'avais complètement oublié la méthode fromCharCode; votre idée est élégante, John, mais la regexp n'est pas correcte, comme expliqué par Olivier, les nombres hexadécimaux comportent également des [a-f]; par ailleurs, un indicateur ignore-case rendrait le tout plus robuste. [/lang]
[lang=en] I had completely forgotten about the fromCharCode method, good insight John, however the regexp isn't correct, as explained by Olivier, hex numbers are also composed of [a-f]; an ignore-case flag would also be safer. [/lang]
X.replace(/&#(x[0-9a-f]+);/gi, function (a, b) { return String.fromCharCode("0"+b) } )
Vide Infra.
I've just done that, and my girlfriend just slapped me... :$
Cheers, Elegie.
nabil kasmi
Merci beaucoup, celà fonctionne impécablement. Je vous souhaite une exelente journée a tous. Cordialement, Nabil
"Elegie" a écrit dans le message de news:460e29b4$0$11939$
Dr J R Stockton wrote:
Hello John,
X = "Papeterie" X = X.replace(/&#(xd+);/g, function (a, b) { return String.fromCharCode("0"+b) } ) // donne "Papeterie"
[lang=fr] J'avais complètement oublié la méthode fromCharCode; votre idée est élégante, John, mais la regexp n'est pas correcte, comme expliqué par Olivier, les nombres hexadécimaux comportent également des [a-f]; par ailleurs, un indicateur ignore-case rendrait le tout plus robuste. [/lang]
[lang=en] I had completely forgotten about the fromCharCode method, good insight John, however the regexp isn't correct, as explained by Olivier, hex numbers are also composed of [a-f]; an ignore-case flag would also be safer.
[/lang]
X.replace(/&#(x[0-9a-f]+);/gi, function (a, b) { return String.fromCharCode("0"+b) } )
Vide Infra.
I've just done that, and my girlfriend just slapped me... :$
Cheers, Elegie.
Merci beaucoup,
celà fonctionne impécablement.
Je vous souhaite une exelente journée a tous.
Cordialement,
Nabil
"Elegie" <elegie@invalid.com> a écrit dans le message de
news:460e29b4$0$11939$426a74cc@news.free.fr...
Dr J R Stockton wrote:
Hello John,
X = "Papeterie"
X = X.replace(/&#(xd+);/g, function (a, b)
{ return String.fromCharCode("0"+b) } ) // donne "Papeterie"
[lang=fr]
J'avais complètement oublié la méthode fromCharCode; votre idée est
élégante, John, mais la regexp n'est pas correcte, comme expliqué par
Olivier, les nombres hexadécimaux comportent également des [a-f]; par
ailleurs, un indicateur ignore-case rendrait le tout plus robuste.
[/lang]
[lang=en]
I had completely forgotten about the fromCharCode method, good insight
John, however the regexp isn't correct, as explained by Olivier, hex
numbers are also composed of [a-f]; an ignore-case flag would also be
safer.
[/lang]
X.replace(/&#(x[0-9a-f]+);/gi, function (a, b)
{ return String.fromCharCode("0"+b) } )
Vide Infra.
I've just done that, and my girlfriend just slapped me... :$
Merci beaucoup, celà fonctionne impécablement. Je vous souhaite une exelente journée a tous. Cordialement, Nabil
"Elegie" a écrit dans le message de news:460e29b4$0$11939$
Dr J R Stockton wrote:
Hello John,
X = "Papeterie" X = X.replace(/&#(xd+);/g, function (a, b) { return String.fromCharCode("0"+b) } ) // donne "Papeterie"
[lang=fr] J'avais complètement oublié la méthode fromCharCode; votre idée est élégante, John, mais la regexp n'est pas correcte, comme expliqué par Olivier, les nombres hexadécimaux comportent également des [a-f]; par ailleurs, un indicateur ignore-case rendrait le tout plus robuste. [/lang]
[lang=en] I had completely forgotten about the fromCharCode method, good insight John, however the regexp isn't correct, as explained by Olivier, hex numbers are also composed of [a-f]; an ignore-case flag would also be safer.
[/lang]
X.replace(/&#(x[0-9a-f]+);/gi, function (a, b) { return String.fromCharCode("0"+b) } )
Vide Infra.
I've just done that, and my girlfriend just slapped me... :$