asp.net text messed issue - asp.net

First of all take a look at website www.elcieloessalud.com/Tratamientos.aspx
I have built this website for a spanish client of mine, it is built in .net framework 3.5
issue is that i have a cms kind of page that allows me to change text of the pages etc.
when changed, text appears perfect in rich text box but page appears messed up. as you can see in the above page lots of aquí,Salvación ,Dios…†etc.. although it should be something like aquí,Salvación,Dios…”
Any help in this help would be appreciated!
Regards,
Umair

Include this on your html header part
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
If you page is not on utf-8, then I suggest to render it on utf-8, or find your charset for your Language and set it. The charset must be the same as your file to have correct render. In the visual studio you can see your char set of your file on the menu: File | Advanced Save Options... In some friends of me this menu is not exist, you can add it on the Tools | Customize. (for more details for how to add it search on internet - there are a lot of info.)
Also you can try to set on web-config (or set your language)
<globalization requestEncoding="utf-8" responseEncoding="utf-8" />

Finally i did it :) with help of #Aristos as well!
we need to include
meta http-equiv="Content-Type" content="text/html; charset=utf-8"
in all the pages including masterpage and change charset of language to whatever yours is
and when creating the streamwriter to write we need to indicate the encoding there as well as below
Dim sw As StreamWriter
sw = New StreamWriter(FileName, False, Encoding.UTF8)
and you are done !! :)
happy coding

Related

Arabic text on masterpage is corrupted like لوحة المعلومات

I have asp.net web application using Arabic language ,I published it and host it on Godaddy .
there is no problem when I get Arabic text from database.
But the text in master page like labels it's appear like لوحة المعلومات
this problem in master page only , not for all pages ,
I tried to use
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
but the text still appear like لوحة المعلومات (only in masterpage)
How can I fix it ?
open the asp page with notepad++
and try save it on other charset (ansi or utf-8)

WindowsAzure html utf-8 encoding issue

I have an Arabic ASP.NET MVC4 website with UTF-8 encoding.
I have declared the encoding as UTF-8 in html layout header and have tried to set globalization settings in web.config.
but when I publish in windows azure. some of the text appears in Arabic characters while others appears in weird characters.
In localhost all the text is Arabic.
To give a live example take a look at the front page:
http://alqalam.azurewebsites.net and look at the top left text.
You can also look at http://alqalam.azurewebsites.net/Account/Login
both links show how some characters are displayed in Arabic and others aren't.
Thank you.
can you try adding ?
<meta http-equiv="Content-Type" content="text/html charset=UTF-8" />

ASP.NET WebForms page is partially Encoding Gibberish.

i have a webform.page, on a master.page.
When I run from VS Development Server, everything looks great... hebrew and stuff :")
When I deploy/upload the files to 'Arvixe.com' shared server.
the page comes half gibberish.
The content of the Master.Page is kept intact.
The content of the Web-form is Gibberish, EXCEPT for text that come from my SQL DATABASE as NVARCHAR.
There are slight differences in the Web.config (other constraints).
tried playing with <globalization> tag.
all pages contain
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
Screenshot - only the Title of the Repeater is hardcoded in the content page
Just Typical...
spend 2 hours searching for the solution.
another 15 min to phrase the question.
and find the solution 2 min after that.
the Content Pages where ANSI so i converted them to UTF8 and uploaded.
Everything is great now both locally, and on the server.

How to convert .aspx pages and master pages to html pages?

I am doing one project in asp .net.Its completed,then the same project will be done in html5. How to convert the .aspx pages and master pages to html 5? Is it possible?If any one know please tell me.
You can technically make the page HTML5 by changing the doctype...
<!DOCTYPE html>
<html lang="en">
<head runat="server">
<meta charset="utf-8" />
It is also recommended that you specify a lang attribute on the html tag and include the meta tag to define your character set.
This won't give you instant HTML5 semantics, but this is essentially step one. Using the right elements for the right kinds of content will be down to you, for example deciding when to use header, article, section, footer instead of plain div elements and so on.
You should also be able to select "DOCTYPE:HTML5" from the toolbar in Visual Studio - I don't know what version you are using, but I think in the previous version you could download a HTML5 language extension, I'm pretty sure it is included by default in Visual Studio 2012.
what you can do... if I understand your question correctly is, rightclick and say view page source and copy your html or install google chrome and the on each page you can go rightclick and inspect element. you can copy and paste the html of each page including the masterpage content. Its a sloppy way but will work if you only want the html
One of the way that i think you can do is to use http://modernizr.com/ kind of framework to switch between html5 and normal html easily .

strange characters on web page

I have a graffiti blog and i have a strange problem which is showing strange char page like this:
alt text http://amrelgarhy.com/ScreenShots/error.jpg
This page was showing when I opened my control panel admin page. It's also showing the same when I try to edit one of my previous posts. My problem is that i don't know what's the reason behind it.
I am not sure how to fix this. All my posts are in English and I always use Windows Live Writer to post.
Has anyone faced a problem like this before? Can you advise me on finding the cause of this problem, and any potential solution?
Looks like it might be an encoding mismatch. Are you opening UTF-8 (or some other Unicode)-encoded files in a tool that doesn't understand UTF encodings or vice-versa?
Try placing this in your master page:
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
Also, check that a virtual directory has been created.
There seems to be a problem with the content MIME-types. The weirdness you are seeing happens because the server offers content as binary (I'm guessing application/octet-stream) even though it should offer them as text/html. Images should be offered as image/<extension>, for example image/png.
You can manually set MIME-type handlers to certain filetypes. If you are using Apache, you could easily to this in a .htaccess file like this:
AddType text/html .html
If your content is something else than HTML the MIME-type is something different. If your web-server doesn't automatically do this you should probably add the handlers yourself.
All MIME-types can be found from here: http://www.iana.org/assignments/media-types/

Resources