Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > How do I get accents to display correctly?

How do I get accents to display correctly?
Thread Tools
Fresh-Faced Recruit
Join Date: Oct 2000
Location: Barcelona, Spain
Status: Offline
Reply With Quote
Jun 13, 2001, 06:11 PM
 
This is driving me nuts.

I want to include some Spanish language text in a web page that will be residing locally on my hard disk.

However, when I view the text through IE or iCab all the accents vanish to be replaced by strange characters.

Selecting different text encodings via their respective menu items doesn't help. What do I have to to make the accents show up?

I'm running OS 9.0.4 (Spanish)
My keyboard is set to Spanish ISO
Text Control Panel is set to Latin (the only option available)
The charset in the HTML file is set correctly.

This code is local on my hard disk (not coming off the internet)

I've tried writing the code in BBedit Lite, Simpletext and AppleWorks (saving as text).

Any ideas would be appreciated.
     
Fresh-Faced Recruit
Join Date: Oct 2000
Location: Texas, USA
Status: Offline
Reply With Quote
Jun 13, 2001, 09:56 PM
 
Hi;
When you type the copy you want in HTML, are you using the correct character codes for the accents or are you just typing the accents themselves like you would in a document?
For example, in HTML, to get a grave accent on the e of the name Jose you would need to type:
José
(UBB is mangling my code! It needs to be Jos ampersand numbersign 233 semicolon. )

The same thing for all the other accents you need; you can't just type them out normally.
A good resource for getting the character codes of different accents is www.webmonkey.com

If you are typing in the character codes, and it's still wigging out on you...hmmm. I don't know.

----
mollicat


[ 06-13-2001: Message edited by: mollicat ]

[ 06-13-2001: Message edited by: mollicat ]
Grace and peace to you
     
Dedicated MacNNer
Join Date: Mar 2000
Location: ireland
Status: Offline
Reply With Quote
Jun 14, 2001, 04:56 AM
 
why does UBB insist on interpreting those HTML codes for accented characters anyway? i had a similar prob trying to show someone else how to rwrite these tags here before. i thought that using the "[code]" tags was meant to cause UBB to print out what you typed without interpreting it?

BTW kryton, dunno if this is true for BBedit lite, but in BBedit if you look under
window>HTML entities
it'll bring up a palette with a list of all the accented characters [and other assorted glyphs] and their associated code. select one and click insert to add it into your source code.

or even better... [again i dunno if this works in BBedit lite], if you go to
markup>utilities>translate
you'll get a dialogue box which allows you to translate text into HTML and vice versa. so if you've already got a load of text with accented characters and don't want to have to hoke through it changing everything by hand, this'll do it instantly for you.

[ 06-14-2001: Message edited by: madra [again!] ]
the original madra - airbrushed out of history in a stalinist manner!

madrasite - crap, junk and drivel
     
Clinically Insane
Join Date: Nov 1999
Status: Offline
Reply With Quote
Jun 14, 2001, 06:54 AM
 
You also might want to encode the text in UTF-8, rather than its current setting. Then you don't need the character codes at all, except for the Big Five: gt, lt, amp, quot, and apos.

If you do that, though, you then restrict your audience to browsers that can support Unicode. However, I don't think I've ever seen one that can't, so I don't think this is going to be much of a problem.
You are in Soviet Russia. It is dark. Grue is likely to be eaten by YOU!
     
Mac Enthusiast
Join Date: Mar 2001
Location: NC, USA
Status: Offline
Reply With Quote
Jun 14, 2001, 02:22 PM
 
I usually use the mnemonic way of displaying special characters. I find it easier and more natural. Here are the most commonly used characters in Spanish:

<blockquote><font size=1 face="Geneva, Verdana, Arial">code:</font><hr><pre>& amp;lt;font size=1 face=courier>
"á" es <font color=red>"a"</font> con acento
"é" es <font color=red>"e"</font> con acento
"í" es <font color=red>"i"</font> con acento
"ó" es <font color=red>"o"</font> con acento
"ú" es <font color=red>"u"</font> con acento
"ñ" es <font color=red>"n"</font> con tilde
"ü" es <font color=red>"u"</font> con dieresis
</font></pre><hr></blockquote>

I think that is just about all of them. Do not put spaces before or after the code if it is in the middle of a word. Por ejemplo:

<blockquote><font size=1 face="Geneva, Verdana, Arial">code:</font><hr><pre>& amp;lt;font size=1 face=courier>
Espa"ñ"a
</font></pre><hr></blockquote>

If you need a capital letter, just substitute the first, lowercase letter, with a capital one:

<blockquote><font size=1 face="Geneva, Verdana, Arial">code:</font><hr><pre>& amp;lt;font size=1 face=courier>
"É"
</font></pre><hr></blockquote>

check out http://www.trianglefreepress.com/noticias.html and view the page source if you need to see it in action.

Cheers!
Edit: It translated my code!
Edit 2: It translates the code no matter what I try. Oh well!
I like your user name Kryton!
[ 06-14-2001: Message edited by: MacmanX ]

[ 06-14-2001: Message edited by: MacmanX ]
Satellite deployment by:
Ace Moving Co.
     
Kryton  (op)
Fresh-Faced Recruit
Join Date: Oct 2000
Location: Barcelona, Spain
Status: Offline
Reply With Quote
Jun 14, 2001, 05:21 PM
 
Thanks for all your replies.

It seems that the only surefire way to make things work is by the special character codes for every instance. This is OK for occasional lines of foreign text but I had hoped to start writing whole pages in Spanish pretty soon. Is there no way to avoid having to include the special character codes? I've seen web pages in Spanish that don't use them but the accents show up fine with a standard ISO-8859-1 charset. Is this because something has been activated on the server side?

The unicode solution appealed to me but I'm afraid I'll have to ask a silly question. How do I encode for UTF-8?

I set the charset to utf-8 in my HTML docs and the accents appeared in iCab but with a nasty side effect, the words that contained the accents appeared using the font that I have selected in the Appearance Control Panel. Not even using a FONT tag could overcome this. It was worse in IE 5. All accented letters were replaced with a '?' and manually selecting the utf encoding from the menu didn't work either.

The mnemonic option is handy and I'll give it a spin but I'm also thinking about setting up a group of text clippings so that I can just drag and drop them into my code.

I have BBedit Lite 4.6 and none of the options mentioned are available. However, I will try out the latest version to see if they are now available in the Lite version.

Any ideas as to why the utf-8 option is not working for me?

Thanks

[ 06-14-2001: Message edited by: Kryton ]
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 10:33 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2