LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 01-03-2017, 03:34 PM   #1
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,659
Blog Entries: 4

Rep: Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941
Why might a copyright-symbol show up as a black diamond in one site but not its twin?


I currently have two web servers that are displaying the same site. (The second one is the soon-to-be successor of the first.)

The character-set of site is Latin-1 as shown by:
Code:
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
... which directive appears in both sites.

However, a "copyright" symbol appears as a black-diamond in one site but not the other, in the same browser. In one, the character appears normally. In the other, black diamond.

curl of the page from both servers and diff and hexdump of the two files shows that the byte is the same.

The font is available in both cases and has been retrieved and stored by the browser in both cases. It is the same font.
 
Old 01-03-2017, 03:45 PM   #2
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 21 MATE
Posts: 8,048
Blog Entries: 5

Rep: Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925
I think the problem may be at web server level. Check to see what you have the server encoding set to (e.g. through its .htaccess files) and the content of the HTTP headers it returns.
 
1 members found this post helpful.
Old 01-03-2017, 05:08 PM   #3
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,659

Original Poster
Blog Entries: 4

Rep: Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941
Bingo. Thank you.

One server sends a header: "Content-Type: 'Text/HTML'" while the other adds "Charset=UTF-8."

Now, what directive would that be ...?

I suppose that this header, if present, overrides any <meta> tag in a particular page of content?

Last edited by sundialsvcs; 01-03-2017 at 05:10 PM.
 
1 members found this post helpful.
Old 01-03-2017, 06:19 PM   #4
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,659

Original Poster
Blog Entries: 4

Rep: Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941
Ooh... I surely hope that folks won't now overlook this thread, now that I marked it as [SOLVED] ...

... because right now I really don't quite understand just where this HTML Header is coming from. The server is a "stock Ubuntu-LTS," and the charset.conf configuration is not enabled.

So ... where-and-why is this server "proclaiming to all to whom these presents may come" that the content is "UTF-8?"

I don't really think that it is coming from this bit of php.ini:
Code:
; PHP's default character set is set to UTF-8.
; http://php.net/default-charset
default_charset = "UTF-8"
... but I really do need to know ...

- - -
Edit: Based on the docs referenced in the file-snippet: "quite clearly, it is not ..."

So, where is it? Is it some sort of recent default? (Notice: the web-site is jumping from Apache 2.2 to 2.4.)

Last edited by sundialsvcs; 01-03-2017 at 06:37 PM.
 
Old 01-03-2017, 09:06 PM   #5
NevemTeve
Senior Member
 
Registered: Oct 2011
Location: Budapest
Distribution: Debian/GNU/Linux, AIX
Posts: 4,864
Blog Entries: 1

Rep: Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869
On directory level, it is option AddDefaultCharset in file .htaccess.

Last edited by NevemTeve; 01-03-2017 at 11:03 PM.
 
Old 01-04-2017, 01:41 AM   #6
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 21 MATE
Posts: 8,048
Blog Entries: 5

Rep: Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925
Yes, HTTP headers override meta tags.

As NevemTeve mentioned, check your .htaccess files for AddDefaultCharset (also AddCharset and AddType). Also, check httpd.conf. If you can't find anything, then set things yourself to serve iso-8859-1.

Given that you haven't yet worked out why the difference occurs, maybe you should remark the thread as "unsolved" in the meantime?

Some info: https://www.w3.org/International/art...-charset/index
 
Old 01-04-2017, 09:29 AM   #7
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,659

Original Poster
Blog Entries: 4

Rep: Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941
I haven't found the directive yet. Is there a default?
 
Old 01-04-2017, 09:56 AM   #8
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,659

Original Poster
Blog Entries: 4

Rep: Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941
Sometimes, I wish I could read ...

Quote:
Originally Posted by PHP.INI:

; By default, PHP will output a character encoding using
; the Content-type: header.
To disable sending of the charset, simply
; set it to be empty.
;
; PHP's built-in default is text/html
; http://php.net/default-mimetype
default_mimetype = "text/html"

; PHP's default character set is set to UTF-8.
; http://php.net/default-charset
default_charset = "UTF-8"
 
Old 01-04-2017, 12:03 PM   #9
NevemTeve
Senior Member
 
Registered: Oct 2011
Location: Budapest
Distribution: Debian/GNU/Linux, AIX
Posts: 4,864
Blog Entries: 1

Rep: Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869
Well, php.ini affects .php files, not .html, .txt, .js etc files...
Are we talking about a .php file?
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] finding the copyright symbol for a document in MATE? Novatian Linux - Newbie 1 09-02-2014 05:41 AM
LXer: Copyright As Censorship: Lawyers Tell Show Inspired By 'The Princess Bride' To Prepare To Die LXer Syndicated Linux News 0 12-11-2013 05:00 AM
LXer: US Can Extradite UK Student For Copyright Infringement, Despite Site Being Legal In The UK LXer Syndicated Linux News 0 01-16-2012 01:50 AM
LXer: Copyright Wars escalate: Britain to extradite student to US over link site LXer Syndicated Linux News 0 01-16-2012 12:50 AM
show me a site:Java alaios Programming 3 06-15-2004 06:21 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 04:53 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration