本文介绍了重音法语字符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

ASPX是否有任何问题来呈现法语重音字符?



我使用utf-8编码。



我从来没有像这样的任何问题(但因为这是我第一次在ASP服务器上工作有任何修复?)



eg
Événements=Événements
Journéesfériées=Journéesfériées



这是一个编码问题吗?



这里是一个



页面显示:

 



<$ p $ d $ p> 应为:

请注意: pre> 

解决方案

有什么问题?您是否在文件顶部的页面指令中设置了@ Codeepage = 65001?您是否使用正确的编码标记内容类型,以便客户端知道它的来源?



如果您看到问号,很可能您没有设置响应代码页。如果您看到两个不相关的字符代替带有变音符号的单个字符,您就没有告诉客户端将网页视为UTF-8,例如

  Response.CodePage = 65001; 
Response.CharSet =utf-8;

asp.net和asp处理编码之间有细微的差别,因此如果



在ASP.Net中,您可以设置编码site- wide在你的web.config文件,所以你可以避免在每一页上的Response.CodePage和Request.CodePage。您仍然希望使用HTML中的元http-equiv content-type元素或使用Response.Charset标记响应字符集。

 ><全球化
requestEncoding =utf-8
responseEncoding =utf-8/>

如果你不想因为某种原因而使用web.config,



您的.aspx文件中的在您输出任何文本之前,包含错误的编码UTF-8。是从.aspx文件直接发送的内容,还是从数据库中取出?


Is there any problem with ASPX to render french accented characters?

I am using utf-8 to encode.

I never had any problem like this before (but since this is the first time I am working on an ASP server is there any fix?)

e.gÉvénements = ÉvénementsJournées fériées = Journées fériées

Is this an encoding problem? or is there any specific code I need to place to render it correctly.

here is an example

The page reads:

Pour recevoir les communications de l’école par courriel, veuillez nous indiquer votre adresse courriel

It should read:

Pour recevoir les communications de l'école par courriel, veuillez nous indiquer votre adresse courriel
解决方案

What's the problem, exactly? Have you set @Codepage=65001 in the page directives at the top of your file? Have you marked the content-type with the correct encoding so that the client knows what its getting?

If you see question marks, it's probable that you haven't set the response code page correctly. If you see two unrelated characters in place of a single character with a diacritic , you haven't told the client what it needs to know to treat the page as UTF-8, e.g.

Response.CodePage = 65001 ;
Response.CharSet = "utf-8" ;

There are slight differences between asp.net and asp handling of encoding, so it would also be helpful if you were more specific about which technology you're using, but that should get you most of the way there.

In ASP.Net, you can set the encoding site-wide in your web.config file, so you can avoid messing with Response.CodePage and Request.CodePage on every page. You still want to mark the Response Charset using the meta http-equiv content-type element in your HTML or using Response.Charset.

<globalization
            requestEncoding="utf-8"
            responseEncoding="utf-8"  />

If you don't want to use web.config for this for some reason, you'd use <%@CodePage=65001 %> in your .aspx file before you output any text, in the page directives.

It looks like the page in question contains incorrectly encoded UTF-8. Is the content coming straight from the .aspx file or is it being pulled from a database or something?

这篇关于重音法语字符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-29 02:48