Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: [1]   Go Down

Author Topic: Weird characters at the beginning of the utf-8 files?  (Read 16634 times)

0 Members and 1 Guest are viewing this topic.

artefact

  • Coppermine newbie
  • Offline Offline
  • Gender: Male
  • Posts: 7
Weird characters at the beginning of the utf-8 files?
« on: September 25, 2004, 01:38:43 am »

I have noticed that each utf-8 file for each language supported in the lang directory are starting with the following characters:

Code: [Select]
ï"¿
Is that a bug? If not what is it use for?

Charles.
« Last Edit: November 11, 2004, 04:56:10 pm by Casper »
Logged

Tranz

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Female
  • Posts: 6149
Re: Weird characters at the beginning of the utf-8 files?
« Reply #1 on: September 25, 2004, 01:55:54 am »

Do you see this with all of them? I sampled some and they all started with
Code: [Select]
<?phpregardless of language.
Logged

artefact

  • Coppermine newbie
  • Offline Offline
  • Gender: Male
  • Posts: 7
Re: Weird characters at the beginning of the utf-8 files?
« Reply #2 on: September 25, 2004, 02:08:55 am »

I see this on all the utf-8 versions.
So english.php is fine but english-utf-8.php has the problem.

I am using 1.3.2 but 1.3.1 already had the problem. Doesn't seem to hurt though.
Logged

Tranz

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Female
  • Posts: 6149
Re: Weird characters at the beginning of the utf-8 files?
« Reply #3 on: September 25, 2004, 02:17:50 am »

I see no weird characters in english-utf-8.php, v. 1.3.2. What are you using to read the files?
Logged

artefact

  • Coppermine newbie
  • Offline Offline
  • Gender: Male
  • Posts: 7
Re: Weird characters at the beginning of the utf-8 files?
« Reply #4 on: September 25, 2004, 03:00:33 am »

Humm, that's bizare.

With Eclipse (PHPEclipse) or Visual SlickEdit I see them but not with notepad...
All this under Windows XP in english.
May be your editor do not display them  ;)

Look in Hex mode, the file starts with:
0xEF 0xBB 0xBF
Logged

Tranz

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Female
  • Posts: 6149
Re: Weird characters at the beginning of the utf-8 files?
« Reply #5 on: September 25, 2004, 03:09:40 am »

I am using Dreamweaver, which should be able to read php files such as the language files.
Logged

Casper

  • VIP
  • Coppermine addict
  • ***
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 5231
Re: Weird characters at the beginning of the utf-8 files?
« Reply #6 on: September 25, 2004, 09:55:05 am »

They are there in all utf-8 files, and visible when using a plain text editor.

They are normal, no need to worry about it.
Logged
It has been a long time now since I did my little bit here, and have done no coding or any other such stuff since. I'm back to being a noob here

Tranz

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Female
  • Posts: 6149
Re: Weird characters at the beginning of the utf-8 files?
« Reply #7 on: September 25, 2004, 10:14:04 am »

I guess I have some setting in Dreamweaver that suppresses those characters. (http://tu2.net/forums/images/smiles/icon_dunno.gif)
« Last Edit: January 15, 2006, 07:01:53 pm by TranzNDance »
Logged

Casper

  • VIP
  • Coppermine addict
  • ***
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 5231
Re: Weird characters at the beginning of the utf-8 files?
« Reply #8 on: September 25, 2004, 04:10:46 pm »

I must admit, they are not visible in all plain text editors.  In fact, notepad does not see them either, but the editor I use, 1st page 2000, does.
Logged
It has been a long time now since I did my little bit here, and have done no coding or any other such stuff since. I'm back to being a noob here

artefact

  • Coppermine newbie
  • Offline Offline
  • Gender: Male
  • Posts: 7
Re: Weird characters at the beginning of the utf-8 files?
« Reply #9 on: September 27, 2004, 11:24:10 pm »

They are there in all utf-8 files, and visible when using a plain text editor.

They are normal, no need to worry about it.

Good, thanks for the info.
I came to the same conclusion after reading about BOM (Byte Order Mark) for unicode data stream.
http://www.unicode.org/unicode/faq/utf_bom.html#BOM

Charles.
Logged

Joel

  • Coppermine newbie
  • Offline Offline
  • Gender: Male
  • Posts: 11
    • Foto Gallery
Re: Weird characters at the beginning of the utf-8 files?
« Reply #10 on: October 04, 2004, 03:24:18 pm »

They are there in all utf-8 files, and visible when using a plain text editor.

They are normal, no need to worry about it.
Do you think so? I don't.
Why a PHP-script have to be marked as / with BOM? 

IE won't display the characters but Firefox do in the upper left corner.  After I removed them everythig looks fine.

Joel
Logged

jasendorf

  • VIP
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 350
    • http://www.338tharmyband.com
Re: Weird characters at the beginning of the utf-8 files?
« Reply #11 on: November 10, 2004, 09:52:22 pm »

They are there in all utf-8 files, and visible when using a plain text editor.

They are normal, no need to worry about it.

It does break the XP Publishing Wizard registry file download.
Logged
Read the Online DOCs,FAQ, and SEARCH the board BEFORE posting questions for help.

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Weird characters at the beginning of the utf-8 files?
« Reply #12 on: November 11, 2004, 06:07:00 am »

John,

good to hear from you again :). There are some issues with XP Publisher that have been reported in the testing/bugs board which are still open (others may have been fixed) - I can't tell for sure, since I don't have Windows XP. Did you check out the CVS to see if those issues have been fixed there? I wouldn't mind to release a bugfix version cpg1.3.3 if there are enough fixes that make it worth the bother, just let me know (maybe we should discuss this on the dev board though).

@devs: there are a lot of reported bugs in the XP Publisher file. Could someone actually running Windows XP take care of them please?

Joachim
Logged

Casper

  • VIP
  • Coppermine addict
  • ***
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 5231
Re: Weird characters at the beginning of the utf-8 files?
« Reply #13 on: November 11, 2004, 04:54:51 pm »

On the utf-8 characters issue, they appear to be put there during the conversion process.  If they cause problems, let's remove them, if that will not create other problems.
I set my test stable gallery to utf-8, and cannot see these characters on the screen at any point. 


Also, my xp_publish works fine when I'm in this mode.  But I am using the version I did 2 weeks ago which fixed the problem of a few people who'se systems did not like the file, caused by an empty line in the code.

As far as I'm aware, there are no outstanding issues with the xp_publish file.  There have been reports of users unable to upload to public albums with this, but that has always been the case, as the instructions point out.  This was to prevent flooding.

If John tests the latest version of xp_publish, and lets us know if he still has issues.  His is the first report I know of that links any xp_publish problem with the use of utf-8 files.

Logged
It has been a long time now since I did my little bit here, and have done no coding or any other such stuff since. I'm back to being a noob here

thinduke

  • Coppermine newbie
  • Offline Offline
  • Posts: 1
Re: Weird characters at the beginning of the utf-8 files?
« Reply #14 on: November 25, 2004, 11:20:56 pm »

Using Coppermine on linux and mozilla although I set the language to french-utf-8, and the pages generated indeed display the correct charset in the html header, Mozilla auto-detects iso-8859-1, and the three characters : ï"¿ are displayed (3 first chars in the html source), and of course the accented letters are wrong. If I manually set the character encoding in  Mozilla to unicode, the three characters disappear and the accented letters are correct.

I ran "iconv -t=UTF-8" on all UTF-8 lang files, which removed the three characters, but the behaviour did not change: iso-8859-1 is still detected. Does it have something to do with the 3 characters? Are there some other files which should be re-converted?

But this happens only on my computer; on my website at my ISP the pages are correctly detected as UTF-8.

Also, some accented letters are wrong in the french-utf-8 file, I guess someone used a non-unicode text editor...
Logged

chtito

  • VIP
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 186
  • I run Mac OS X, despite the penguin ;)
Re: Weird characters at the beginning of the utf-8 files?
« Reply #15 on: November 28, 2004, 12:17:23 am »

But this happens only on my computer; on my website at my ISP the pages are correctly detected as UTF-8.

There may be one tricky explanation. A user agent looks for three places to determine the encoding to be used.
1)The http header
2)The xml encoding
3)The encoding in the meta tag

The first one encountered supercedes the others. So if your personal web server is configured to serve html files in iso-8859-1, the utf-8 files generated by cpg will be all messed up.

The reason is that coppermine currently does not override this setting (because it does'nt use the http header to specify the encoding). But if you want cpg to override the server settings, this can be easily done by adding header('Content-Type: text/html; charset=utf-8'); in the pageheader function of the theme.php file that you're using.

Hope this helps!

cheers!
Logged
Vous pouvez poser vos questions en français sur le forum francophone !
Pages: [1]   Go Up
 

Page created in 0.042 seconds with 20 queries.