Batch add files problem with languages files, UTF-8 signature and Notepad Batch add files problem with languages files, UTF-8 signature and Notepad
 

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]

Main Menu

Batch add files problem with languages files, UTF-8 signature and Notepad

Started by Makc666, February 28, 2006, 03:29:24 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Makc666

The problem was solved.
Read whole topic to get things out.
In brief: When you modify any file in UTF-8 format with Notepad and saves that file, Notepad adds so called UTF-8 signature to the beginning of the file.
That signature can be seen only in special editor!!

When you upload such language files to your gallery some things will stop working, for example Batch add tool will not function correctly with thumbnails.
See the text below.


This problem is very strange.
There is default language file russian.lng
When I edit it, add some new lines and upload to server, some strange thing happens.

When I open Batch page on my gallery,
(the url looks like this: http://coppermine-gallery.net/demo/cpg14x/searchnew.php?startdir=folders/test&lang=russian )
Then I select necessary folder and press Ok.
When the page opens, the thumbnails are no showen on that page.
I see only red crosses...
See screenshot #1
But. If I press/switch to english at that moment by following the ulr:
http://coppermine-gallery.net/demo/cpg14x/searchnew.php?startdir=folders/test&lang=english
the thumbnails are showen correct.
See screenshot #2

In other words,
if I open:
http://coppermine-gallery.net/demo/cpg14x/searchnew.php?startdir=folders/test&lang=russian
I didn't see thumbs

if I open:
http://coppermine-gallery.net/demo/cpg14x/searchnew.php?startdir=folders/test&lang=english
I see thumbs

The same problem for result page...
When I switch to English language and add files I see OK signs.

When I switch to Russian language and and files I see red crosses as on screenshot #1.

If I upload russian.lng which comes in cpg1.4.4.zip all works ok.
If I modify russian.lng and upload it - I get this strange error. ???

But the MOST strange thing that if I remove all those lines which I have added from russian.lng , save it and upload, this BUG still exists!!!
Even Araxis Merge v6.5 showes that files are the same.

I upload modified russian.lng

P.S. The same problem with german.lng

Nibbler

Don't put a blank line at the end of the file.

Makc666

Quote from: Nibbler on February 28, 2006, 03:35:27 PM
Don't put a blank line at the end of the file.
Nibbler,
I removed blank line from russian.lng but it didn't help.
Also I tried to add blank line to english.php but when I add it there were no problems with thumbnails.
So, I think blank line is not the reason.

Makc666

I foung where was the BUG.
I remember one thing and check it.
And I was right.

1. I went to sheel mode of my server.
2. Opened russian.php there and see these strange symbols there. See screenshot.
3. I removed them and know all is ok.

Now I am thinking, why Notepad as well Araxis Merge v6.5 adds that symbols at the beginning of the file.

Makc666

#4
I found where was the problem.

The main problem is with Windows Notepad!!!
It saves UTF-8 files with "signature"!!!

I checked Araxis Merge v6.5 setting and foung out that there is choice between Default character encoging:

  • UTF-8
  • UTF-8 (no signature)

See screenshot #1

So. To save language file properly you have to select Save from Araxis Merge v6.5 menu.
And found there Save your_file_name As...
See screenshot #2

And than select proper Encoding: UTF-8 (no signature)
See screenshot #3

That it.

In Araxis Merge 2010 there are two options:

  • Unicode (UTF-8 with BOW)
  • Unicode (UTF-8 without BOW)

You need Unicode (UTF-8 without BOW)

Makc666

#5
And another post, about how to remove that UTF-8 signature with WinHex

1. Open your file in WinHex in edit mode.
2. Select that UTF-8 signature with your mouse.
3. Press right click and select Edit.
See screenshot #1

4. In the next appeared menu select Cut...
See screenshot #2

5. Agree with warning that: "Cutting the current block will decrease the file size. Continue?"
See screenshot #3

6. Save and Close file.

That it...