OVH Cloud OVH Cloud

codage

4 réponses
Avatar
frouty
Bonjour,

Je comprends pas grand chose au codage.
Voila j'ai =E9crit un fichier en xhtml avec une application bluefish
qui est une application graphique pour le html.

Maintenant je l'ouvre avec emac21 mais voila les
caracteres accentu=E9es ne s'affiche pas correctement.

Si je tape un nouveau caratere accentu=E9 pas de probleme.

Je suis all=E9 faire un tour dans les menus de "mule"
mais j'arrive =E0 rien.

Pour info dans mon fichier j'ai:

<meta http-equiv=3D"content-type" content=3D"text/html; charset=3DUTF-8">
<meta http-equiv=3D"content-type" content=3D"application/xhtml+xml;
charset=3DUTF-8">

Si quelqu'un pouvait m'=E9clairer
Merci

4 réponses

Avatar
lhabert
"frouty" :

Je comprends pas grand chose au codage.
Voila j'ai écrit un fichier en xhtml avec une application bluefish
qui est une application graphique pour le html.

Maintenant je l'ouvre avec emac21 mais voila les
caracteres accentuées ne s'affiche pas correctement.



Ton fichier est encodé en utf-8, mais emacs n'en est pas conscient et
l'ouvre comme du latin-1. Tu peux faire un M-x prefer-coding-system, et
entrer « utf-8 » avant d'ouvrir le fichier, pour qu'il tente d'abord
de lire les fichiers comme de l'utf-8, et de n'essayer le latin-1 que si ce
n'est pas de l'utf-8 valide.
Avatar
Pascal Bourguignon
"frouty" writes:

Bonjour,

Je comprends pas grand chose au codage.
Voila j'ai écrit un fichier en xhtml avec une application bluefish
qui est une application graphique pour le html.

Maintenant je l'ouvre avec emac21 mais voila les
caracteres accentuées ne s'affiche pas correctement.

Si je tape un nouveau caratere accentué pas de probleme.

Je suis allé faire un tour dans les menus de "mule"
mais j'arrive à rien.

Pour info dans mon fichier j'ai:

<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta http-equiv="content-type" content="application/xhtml+xml;
charset=UTF-8">

Si quelqu'un pouvait m'éclairer



Kill ce buffer et réouvre le avec:

C-x RET f utf-8 RET C-x C-f fichier.html RET

Tu peux configurer emacs pour utiliser utf-8 par défaut, en mettant
dans ~/.emacs :

(prefer-coding-system 'utf-8)

ou pour utiliser utf-8 par défaut pour les fichiers .html,

(modify-coding-system-alist 'file ".html'" 'utf-8)

ou juste pour ce fichier là, en ajoutant un commentaire sur la seconde
ligne:

<doctype ...>
<!-- -*- coding:utf-8 -*->
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta http-equiv="content-type" content="application/xhtml+xml;charset=UTF-8">
...


Mais normalement, les modes html/sgml/xml devraient trouver
automatiquement le tag meta et le charset...

--
__Pascal Bourguignon__ http://www.informatimago.com/

"You question the worthiness of my code? I should kill you where you
stand!"
Avatar
frouty
Pascal Bourguignon a écrit :


(prefer-coding-system 'utf-8)



Ca marche tres bien


ou pour utiliser utf-8 par d?faut pour les fichiers .html,

(modify-coding-system-alist 'file ".html'" 'utf-8)


Pas essayer car tous mes fichiers html ne sont pas en
utf8


ou juste pour ce fichier l?, en ajoutant un commentaire sur la seconde
ligne:

<doctype ...>
<!-- -*- coding:utf-8 -*->
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta http-equiv="content-type" content="application/xhtml+xml;charse t=UTF-8">
...



Marche pas

Merci

Mais normalement, les modes html/sgml/xml devraient trouver
automatiquement le tag meta et le charset...

--
__Pascal Bourguignon__ http://www.informatimago.com/

"You question the worthiness of my code? I should kill you where you
stand!"
Avatar
Pascal Bourguignon
"frouty" writes:
<doctype ...>
<!-- -*- coding:utf-8 -*->
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta http-equiv="content-type" content="application/xhtml+xml;charset=UTF-8">
...



Marche pas



Oops, j'ai mélangé les deux fins de commentaire. Mettre:

<!-- -*- coding:utf-8 -*- -->



--
__Pascal Bourguignon__ http://www.informatimago.com/

Nobody can fix the economy. Nobody can be trusted with their finger
on the button. Nobody's perfect. VOTE FOR NOBODY.