Advanced search  

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Pages: [1]   Go Down

Author Topic: Batch add files problem with languages files, UTF-8 signature and Notepad  (Read 21729 times)

0 Members and 1 Guest are viewing this topic.

Makc666

  • Translator
  • Coppermine addict
  • **
  • Offline Offline
  • Gender: Male
  • Posts: 1614
  • Русский (ISO-8859-1) - Russian - Русский (Windows)
    • Makc's home page

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
« Last Edit: March 01, 2006, 10:17:41 am by GauGau »
Logged

Nibbler

  • Guest
Re: Batch add files problem with languages files
« Reply #1 on: February 28, 2006, 03:35:27 pm »

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

Makc666

  • Translator
  • Coppermine addict
  • **
  • Offline Offline
  • Gender: Male
  • Posts: 1614
  • Русский (ISO-8859-1) - Russian - Русский (Windows)
    • Makc's home page
Re: Batch add files problem with languages files
« Reply #2 on: February 28, 2006, 03:53:05 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.
Logged

Makc666

  • Translator
  • Coppermine addict
  • **
  • Offline Offline
  • Gender: Male
  • Posts: 1614
  • Русский (ISO-8859-1) - Russian - Русский (Windows)
    • Makc's home page
Re: Batch add files problem with languages files
« Reply #3 on: February 28, 2006, 04:02:52 pm »

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.
Logged

Makc666

  • Translator
  • Coppermine addict
  • **
  • Offline Offline
  • Gender: Male
  • Posts: 1614
  • Русский (ISO-8859-1) - Russian - Русский (Windows)
    • Makc's home page
How to remove UTF-8 signature with Araxis Merge
« Reply #4 on: February 28, 2006, 04:23:45 pm »

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)
« Last Edit: August 20, 2010, 11:21:38 pm by Makc666 »
Logged

Makc666

  • Translator
  • Coppermine addict
  • **
  • Offline Offline
  • Gender: Male
  • Posts: 1614
  • Русский (ISO-8859-1) - Russian - Русский (Windows)
    • Makc's home page
How to remove UTF-8 signature with WinHex
« Reply #5 on: February 28, 2006, 04:34:38 pm »

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...
« Last Edit: February 28, 2006, 04:41:29 pm by Makc666 »
Logged
Pages: [1]   Go Up
 

Page created in 0.026 seconds with 20 queries.