Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > a language encoding issue

Reply
Thread Tools

a language encoding issue

 
 
JD
Guest
Posts: n/a
 
      03-31-2009
Hi,

I am a yahoo group user. It has a table (<table> .. </table>) where I can
enter text which will show up in the group's home page. I want to enter
text in a non-English languag. So, I use the following pair to enclose my
text.

<SPAN LANG="UTF-8">
....
</SPAN>

But the text is not shown properly. I will have to set "charset" for
browsers to encode properly (as shown below).

<meta http-equiv="Content-Type" content="text/html; charset=...">

The thing is that charset should be set in a page head section. I have no
control over that during entering text into the yahoo group table. Is it
possible to switch different language encouding inside a span (<SPAN> ..
</SPAN>)?

Any help would be much appreciated.

JD





 
Reply With Quote
 
 
 
 
Beauregard T. Shagnasty
Guest
Posts: n/a
 
      03-31-2009
JD wrote:

> I am a yahoo group user. It has a table (<table> .. </table>) where I
> can enter text which will show up in the group's home page. I want
> to enter text in a non-English languag.


Are you typing into the cell of a table? A <td> ... </td> ?

> So, I use the following pair to enclose my text.
>
> <SPAN LANG="UTF-8">


utf-8 is not a LANGuage. English, or French are languages.

> ...
> </SPAN>
>
> But the text is not shown properly. I will have to set "charset" for
> browsers to encode properly (as shown below).
>
> <meta http-equiv="Content-Type" content="text/html; charset=...">
>
> The thing is that charset should be set in a page head section. I
> have no control over that during entering text into the yahoo group
> table.


That never works, anyway. What charset do the page's response headers
show. It may already be utf-8.

> Is it possible to switch different language encouding inside
> a span (<SPAN> .. </SPAN>)?


<span> will be canceled by the next block element. Use <div> .. </div>
instead.

--
-bts
-Friends don't let friends drive Windows
 
Reply With Quote
 
 
 
 
Beauregard T. Shagnasty
Guest
Posts: n/a
 
      03-31-2009
JD wrote:

> You were right. I am typing into a table cell. Also, it's wrong to
> use UTF-8 in the language tag. I already corrected it but text is
> still not properly shown. I check the source of the page. All the
> charset occurences are utf-8 already. But none of them show up
> between <head> .. </head>.


Again, placing meta-charset lines doesn't do anything *unless* your
server is sending as charset: none. In Firefox, while viewing the page,
do Tools > Page Info and see what it says for encoding. You can also
install the Web Developer Toolbar, and see Response Headers.
http://chrispederick.com/work/web-developer/

> I also change from the SPAN tag to DIV tag, but it doesn't help.


Maybe if you would give a link to the page, or one the masses can
access, and tell exactly what language you _want_ to use (you know, like
Greek or Chinese or Russian), maybe someone will have some more advice.

Please don't top-post.

--
-bts
-Friends don't let friends drive Windows
 
Reply With Quote
 
Beauregard T. Shagnasty
Guest
Posts: n/a
 
      03-31-2009
JD wrote:

> "Beauregard T. Shagnasty" wrote:
>> Maybe if you would give a link to the page, or one the masses can
>> access, and tell exactly what language you _want_ to use (you know, like
>> Greek or Chinese or Russian), maybe someone will have some more advice.

>
> I would appreciate it very much if you or someone could look into the
> following link:
>
> http://groups.yahoo.com/group/EnyoungCCCTO/


That page's server (a Linux server running YTS/1/17/9 software) is
already sending: Encoding ISO-8859-1

You will not be able to change it. Follow Ben C's advice about using
numeric character entities; that would be your only recourse.

--
-bts
-Friends don't let friends drive Windows
 
Reply With Quote
 
JD
Guest
Posts: n/a
 
      03-31-2009
"Ben C" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> On 2009-03-31, JD <(E-Mail Removed)> wrote:
>> Hi,
>>
>> I am a yahoo group user. It has a table (<table> .. </table>) where I
>> can
>> enter text which will show up in the group's home page. I want to enter
>> text in a non-English languag. So, I use the following pair to enclose
>> my
>> text.
>>
>><SPAN LANG="UTF-8">
>> ...
>></SPAN>
>>
>> But the text is not shown properly. I will have to set "charset" for
>> browsers to encode properly (as shown below).
>>
>><meta http-equiv="Content-Type" content="text/html; charset=...">
>>
>> The thing is that charset should be set in a page head section. I have
>> no
>> control over that during entering text into the yahoo group table. Is it
>> possible to switch different language encouding inside a span (<SPAN> ..
>></SPAN>)?
>>
>> Any help would be much appreciated.

>
> No, you can't change the encoding half-way through the page.
>
> If the original encoding is, say, Latin-1 and you want to insert some
> Chinese (which is not representable in Latin-1), you can use numeric
> entities.
>
> e.g. like this 什么是
>
> You could write your original Chinese (or whatever is is) in a text
> editor, then use a program called "recode" which you can download to
> turn it into those entities. Then paste that into the web page.
>
> http://www.gnu.org/software/recode/


Thank you both, Beauregard and Ben. You both answer my questions. I was
wondering why the yahoo server sometimes changed my text into those funny
numeric entrities. I always changed them back for easy maintenance. Now I
will follow your instruction to recode first and then copy/paste. Thanks so
much for the help.

JD




 
Reply With Quote
 
John Hosking
Guest
Posts: n/a
 
      03-31-2009
Beauregard T. Shagnasty wrote:
> JD wrote:
>
>> ... Also, it's wrong to
>> use UTF-8 in the language tag. I already corrected it but text is
>> still not properly shown. I check the source of the page. All the
>> charset occurences are utf-8 already. But none of them show up
>> between <head> .. </head>.

>
> Again, placing meta-charset lines doesn't do anything *unless* your
> server is sending as charset: none.
>


This is a very interesting statement to me, Beauregard, as I just
responded to somebody in another group on this same subject. I acted as
if I knew what I was talking about, but your statement makes me suddenly
unsure.

The poster (<(E-Mail Removed)>) was using
meta http-equiv in her <head> but the W3C validator didn't find any
encoding and therefore failed to check the page.

In my response (<49d14ce9$(E-Mail Removed)>), I told her that the
http-equiv was moot, since her server was sending "charset=none". Now
you make me think that was an incorrect analysis of her problem.

Would you care to pop over to c.i.w.a.html and clear things up in that
thread? Or perhaps post again here with further explication or a pointer
to something about what "none" means (Googling didn't help me here)?

--
John
 
Reply With Quote
 
Beauregard T. Shagnasty
Guest
Posts: n/a
 
      03-31-2009
John Hosking wrote:

> Beauregard T. Shagnasty wrote:
>> Again, placing meta-charset lines doesn't do anything *unless* your
>> server is sending as charset: none.

>
> This is a very interesting statement to me, Beauregard, as I just
> responded to somebody in another group on this same subject. I acted
> as if I knew what I was talking about, but your statement makes me
> suddenly unsure.


Actually, I based my above reply on your post in the other group, 'cause
I surely thought you knew what you were talkin' about.

It sounds logical. If the server already sends one (such as the OP's
sample page) like ISO-8859-1, then no manner of <meta> HTML code will
change it. Unless - possibly - there isn't one from the server.

--
-bts
-Friends don't let friends drive Windows
 
Reply With Quote
 
dorayme
Guest
Posts: n/a
 
      03-31-2009
In article <gqt2ak$987$(E-Mail Removed)>,
"Beauregard T. Shagnasty" <(E-Mail Removed)> wrote:

> JD wrote:
>
> > "Beauregard T. Shagnasty" wrote:
> >> Maybe if you would give a link to the page, or one the masses can
> >> access, and tell exactly what language you _want_ to use (you know, like
> >> Greek or Chinese or Russian), maybe someone will have some more advice.

> >
> > I would appreciate it very much if you or someone could look into the
> > following link:
> >
> > http://groups.yahoo.com/group/EnyoungCCCTO/

>
> That page's server (a Linux server running YTS/1/17/9 software) is
> already sending: Encoding ISO-8859-1
>


Earlier you said "In Firefox, while viewing the page, do Tools > Page
Info and see what it says for encoding". On my Mac FF, Tools > Page Info
says UTF-8. Using Web Developer Tools/Validate HTML, No Character
Encoding Found! Falling back to windows-1252.

--
dorayme
 
Reply With Quote
 
Beauregard T. Shagnasty
Guest
Posts: n/a
 
      03-31-2009
dorayme wrote:

> "Beauregard T. Shagnasty" wrote:
>> JD wrote:
>>> http://groups.yahoo.com/group/EnyoungCCCTO/

>>
>> That page's server (a Linux server running YTS/1/17/9 software) is
>> already sending: Encoding ISO-8859-1

>
> Earlier you said "In Firefox, while viewing the page, do Tools > Page
> Info and see what it says for encoding". On my Mac FF, Tools > Page
> Info says UTF-8. Using Web Developer Tools/Validate HTML, No
> Character Encoding Found! Falling back to windows-1252.


Hmm, looking again (with Firefox 3.0.8 on Ubuntu), the Page Info says:

Address: http://groups.yahoo.com/group/EnyoungCCCTO/
Type: text/html
Render Mode: Standards compliance mode
Encoding: ISO-8859-1
Size: 32.07 KB (32,842 bytes)
Modified: Tue 31 Mar 2009 03:09:19 PM EDT

Using WebDevTool Response Header:

Date: Tue, 31 Mar 2009 19:12:55 GMT
P3P: policyref="http://info.yahoo.com/w3c/p3p.xml", CP="CAO DSP COR CUR
ADM DEV TAI PSA PSD IVAi IVDi CONi TELo OTPi OUR DELi SAMi OTRi UNRi
PUBi IND PHY ONL UNI PUR FIN COM NAV INT DEM CNT STA POL HEA PRE LOC
GOV"
Set-Cookie: GP=v=2&a=l&t=1238526775; path=/; expires=Tuesday,
07-Apr-2009 23:59:59 GMT; domain=groups.yahoo.com
G=v=7&data=qHKuZCakakv2HJi4rBE4p7uFLeg6C6lPiW5OQjR A4d1rrHas-nworB9tXQyYTnZo8JPclS43Xz1g8JVcMUlyqsYe2PZXHEawGK9 lcMlkZBQk4VIEOLiMSEAUVQKd2A3ib_kE0pPV1FaPXiTJ8qbq9 mapSxvKJZruXtn-3jw3X-uvEcFdkGAwvr3eQ68EapHvP6uapXBCdDY4aby-CU6nsXwA5AlT9dttCcpqdezzs4NeiaWsro3g9XCQBQmXn697TX iWLcDtZ81phyyxb97f70X1_k53GYXM91lG0an2sopz4WCtp5tX W2UwpitaR78YaMgLZkIf8EyxWHmlj0djQ7tuNboPatg5OlrMlA BPYP72CxsfR3RvDTuspb3ZJyiLRD_QWAfd5NDtblbTtIvh959s 21pyVdfvBZNffg03YEVKHbYQa_lfTV7DAI92Nvvp4RlgP1F7ni YdL9P3C5Ylzi1eprDwDLjTzw&n=12;
path=/group/EnyoungCCCTO/; domain=groups.yahoo.com
Pragma: no-cache
Expires: Fri, 01 Jan 1999 00:00:00 GMT
Cache-Control: no-cache, must-revalidate, no-cache="Set-Cookie", private
Vary: Accept-Encoding
Content-Type: text/html
Content-Encoding: gzip
Age: 0
Transfer-Encoding: chunked
Connection: keep-alive
Server: YTS/1.17.9

200 OK

Don't know what else to tell ya.

--
-bts
-Friends don't let friends drive Windows
 
Reply With Quote
 
dorayme
Guest
Posts: n/a
 
      03-31-2009
In article <gqtq4a$6ip$(E-Mail Removed)>,
"Beauregard T. Shagnasty" <(E-Mail Removed)> wrote:

> dorayme wrote:
>
> > "Beauregard T. Shagnasty" wrote:
> >> JD wrote:
> >>> http://groups.yahoo.com/group/EnyoungCCCTO/
> >>
> >> That page's server (a Linux server running YTS/1/17/9 software) is
> >> already sending: Encoding ISO-8859-1

> >
> > Earlier you said "In Firefox, while viewing the page, do Tools > Page
> > Info and see what it says for encoding". On my Mac FF, Tools > Page
> > Info says UTF-8. Using Web Developer Tools/Validate HTML, No
> > Character Encoding Found! Falling back to windows-1252.

>
> Hmm, looking again (with Firefox 3.0.8 on Ubuntu), the Page Info says:
>
> Address: http://groups.yahoo.com/group/EnyoungCCCTO/
> Type: text/html
> Render Mode: Standards compliance mode
> Encoding: ISO-8859-1
> Size: 32.07 KB (32,842 bytes)
> Modified: Tue 31 Mar 2009 03:09:19 PM EDT
>

I get similar *except* for encoding, where I get UTF-8 and:

Modified: Wed, 1 Apr 2009 5:44:25 AM (obviously nothing - just due to
you not living in the little beautest bit of the world <g>)

Could this be a web browser sensitive matter? Got me?

....
>
> Don't know what else to tell ya.


You could say quite how you are getting WebDevTool Response Header. Not
sure I am getting this one? There is stuff in the page that comes up
with Validate HTML but you talking a different command?

--
dorayme
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting 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 Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Reading Text File Encoding and converting to Perls internal UTF-8 encoding sln@netherlands.com Perl Misc 2 04-17-2009 11:22 PM
International language encoding conversion newbie Ruby 0 11-14-2008 04:07 PM
sample for base64 encoding in c language aruna.eies.eng@gmail.com C Programming 14 07-09-2007 03:55 AM
changing JVM encoding; setting -Dfile.encoding doesn't work pasmol@plusnet.pl Java 1 10-08-2004 09:50 PM
Encoding.Default and Encoding.UTF8 Hardy Wang ASP .Net 5 06-09-2004 04:04 PM



Advertisments