Forum Moderators: open

Message Too Old, No Replies

Formatting problems with SHTML / Swedish characters

SHTML / Swedish Character files

         

tog316

5:51 pm on Jan 7, 2006 (gmt 0)

10+ Year Member



Hi,

I'm building a site in SHTML and want for it to be in Swedish, therefore need to use Swedish characters.

I edit the files in "WordPad" and than save them as .shtml. Problem is that every time I save them when I open the Swedish Characters come out as?.

Anyone have any idea how or maybe which software I should use to edit these shtml files?

Thanks!
TOG

JAB Creations

3:04 am on Jan 8, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hello Tog and welcome to WebmasterWorld.

I edit pages in notepad and when you "save as" there is an encoding option at the bottom. I believe "save and forget" works fine as I constantly edit over 20 translation pages that when I go back and edit notepad does not prompt me again (it's smart enough to realize it's the encoding I set prior and not to mess with it).

Wordpad looks a bit different and I do not like the encode options there, a bit fuzzy. Golden rule is, if it does not explicitly declare that it is what you want assume it's not what you want.

There are better text editors around though I do my coding in notepad. Textedit is what I use to open access logs and it has some nice options plus once I'm not utterly broke I will buy a copy (but you can use it fine until you can). There are of course plenty of other editors and it depends on what your preference is. Textpad has to be manually setup if you like your windows keystroke (ctrl+x for cut in example versus other programs may use (going to make something up here) alt+c). Look around and expand your options. Usually when I find something that works perfect, I save the install file(s) and buy it (if I have the money at the time).

In my opinion you can work with things better then Wordpad. The only thing I use Wordpad for is when I have to format a non-windows text file. Usually you'll see square blocks where line breaks should be in Notepad (so I simply open the file with Wordpad, save, and then open it back in Notepad). Thats Wordpad's only use for me.

I hope this helps to an extent but if you're dead set on using Wordpad then you'll probably want someone else's opinion.

John

encyclo

3:14 am on Jan 8, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Welcome to the forums tog316!

Wordpad is not really an appropriate tool for what you are doing - it will not always handle the files appropriately for web use. Your best tool would be a text editor designed for web development: many possibilities exist, some free, including HTML-Kit, TextEdit, Editpad, Editplus, and many others. Notepad is problematic too despite being surprisingly popular for web development use.

The problem you are experiencing is related to the character encoding ("charset") of the page as displayed by the browser. Are you declaring a charset on the page with a meta charset tag or other? If not, you have two possibilities: you can save the files as ISO-8859-1 (which contains the characters for Swedish), or if your editor specifically supports it, then you could use UTF-8.

I wrote a short introduction to character encoding a while ago that you might find useful:

[webmasterworld.com...]

tog316

4:06 pm on Jan 8, 2006 (gmt 0)

10+ Year Member



Hi all thanks for the replies.

I tried edit+ and the only format where the page displays correctly was "western European".

BUT, when I see the source code I get a lot of weird characters, meaning that search engines would not scan this site as correct Swedish.

Here is the page: <snip> (not all of it is Swedish)

Look at the source code, looks very odd.

Best

TOG

[edited by: encyclo at 7:51 pm (utc) on Jan. 8, 2006]
[edit reason] No URLs please! See TOS [webmasterworld.com] [/edit]

encyclo

7:55 pm on Jan 8, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If the page displays correctly with "Western European" then you need to declare the charset as ISO-8859-1 for the page. The easiest way is with a charset meta tag. It should read:

<meta http-equiv="Content-Type" content="text/html; charset=[b]ISO-8859-1[/b]">

This should be placed before the

title
element in the
head
section of your page. If you are declaring a different charset (such as UTF-8) the page will display incorrectly unless you explicitly convert the page contents to that charset.

tog316

8:18 pm on Jan 8, 2006 (gmt 0)

10+ Year Member



Thanks.

Problem is that the weird fonts appear in the source code.

What can I do?

Thanks

encyclo

8:58 pm on Jan 8, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If you are talking about within the source code when view in a browser, they only appear as such if you are declaring the incorrect charset - meaning that the browser interprets them incorrectly. If you change your declared charset to ISO-8859-1 then they will appear correctly.

tog316

9:19 pm on Jan 8, 2006 (gmt 0)

10+ Year Member



HI Tried it,

still appears odd, with the ISO-8859-1 encoding.

Best
TOG

encyclo

1:46 am on Jan 9, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Do you mean that it appears "odd" in that the accented characters are replaced by question marks or square boxes when viewed in the browser, or does it appear odd when you open the file in your text editor?

You may need to copy/paste your original content to your text editor again and re-save with ISO-8859-1 encoding (Western European). Then replace any unrecognized characters in the source code and re-upload the result.

tog316

8:49 am on Jan 9, 2006 (gmt 0)

10+ Year Member



HI,

When viewed in the browser, I will try though.

Best
TOG