Ticket #6 (closed defect: fixed)

Opened 2 years ago

Last modified 2 years ago

Wrong (broken) installation of script with russian charsets (in unicode 65001)

Reported by: kafl..@mail.ru Assigned to:
Priority: major Milestone:
Version: Keywords:
Cc: arantius@gmail.com

Description

When i try to install my script (http://userscripts.org/scripts/show/7979) with latest versions of Greasemonkey (all of 2007), greasemonkey broke all russian charters in script to something very strange after that script does not work. But if i manually replace script, in gm_scripts directory afre installation, on correct verstion its work.

Attachments

bug6.patch (0.7 kB) - added by aranti..@gmail.com on 03/27/07 18:25:50.
in .patch format

Change History

03/25/07 09:18:38 changed by aranti..@gmail.com

What is "unicode 65001" ? Can you attach a copy of this script (preferably ZIPped or otherwise compressed to ensure the text content is not altered) to this ticket?

This would probably seem to be a problem with a) your character encoding and b) userscripts.org . You can see that us.o always returns "charset utf-8" in the headers. If your file is not UTF-8, that's probably the issue.

(follow-up: ↓ 4 ) 03/25/07 09:18:52 changed by aranti..@gmail.com

  • cc set to aranti..@gmail.com.

03/26/07 07:30:15 changed by hwasung.k..@gmail.com

GM loads a script in UTF-8, but saves in Unicode. It needs to convert the charset before writing to a file.

In scriptdownloader.js,

var base = this.script.name.replace(/[^A-Z0-9_]/gi, "").toLowerCase();  
file.append(base + ".user.js");  

var converter =  
  Components.classes..@mozilla.org/intl/scriptableunicodeconverter"]  
            .createInstance(Components.interfaces.nsIScriptableUnicodeConverter);  
converter.charset = "UTF-8";  
source = converter.ConvertFromUnicode(source);  

var ws = getWriteStream(file);  
ws.write(source, source.length);  
ws.close();

03/27/07 18:25:50 changed by aranti..@gmail.com

  • attachment bug6.patch added.

in .patch format

(in reply to: ↑ 2 ) 03/29/07 08:19:52 changed by kafl..@kaflan.ru

Replying to aranti..@gmail.com: "Can you attach a copy of this script (preferably ZIPped or otherwise compressed to ensure the text content is not altered) to this ticket?" When you download this script by download manager (not by installing with greasemonkey) you have correct file (66.7 Kb). If you install it with greasemonkey you get broken file in broken encoding and with broken size.

"This would probably seem to be a problem with a) your character encoding " If i replace broken file with correct one in gm_script folder all work normally.

"b) userscripts.org ." No matter where from i install this script. If i install it with GM i got broken file.

I use this encoding becouse i need to support file by IE, FF and Opera. So it work now for this 3 browsers but installation for FF + GM is very complex... (need replace file in gm_scripts after installation).

I see ".patch" file now going to get sources to apply this patch. The send you report about my expirence.

03/30/07 09:45:17 changed by anonymous

Looks good to commit.

03/30/07 09:49:41 changed by boo..@youngpup.net

Looks good to submit. Thanks for fixing the indenting.

03/30/07 09:50:19 changed by boo..@youngpup.net

Crap! double crap! Ok, first comment was from me :-), second one was meant for a different page.

04/06/07 05:41:19 changed by anonymous

04/14/07 16:09:56 changed by aranti..@gmail.com

  • status changed from new to closed.
  • resolution set to fixed.

(In [418]) Closes #6

  • As submitted in a comment on this bug, convert character set to UTF-8 when saving an installed script.

07/05/07 10:26:50 changed by anonymous

  • cc changed from aranti..@gmail.com to None.
  • keywords set to None.
  • summary changed from Wrong (broken) installation of script with russian charsets (in unicode 65001) to None.
  • priority changed from major to minor.

07/12/07 12:03:18 changed by loucypher.m..@gmail.com

  • cc changed from None to aranti..@gmail.com.
  • keywords deleted.
  • summary changed from None to Wrong (broken) installation of script with russian charsets (in unicode 65001).
  • priority changed from minor to major.

07/25/07 03:35:02 changed by anonymous

  • status changed from closed to reopened.
  • resolution deleted.

Ïðèâåò Áåêêè,Äåâèä,Ìàéêë,Ðîññè.Ïèñüìî Âàøåå ïîëó÷èëà,íî ê ñîæàëåíèþ íå ñìîãëà ïåðåâåñòè íà ðóññêèé ÿçûê.Íî çà ïèñüìî Âàì áîëüøîå ñïàñèáî.Ïîñòàðàþñü åãî ïåðåâåñòè,è òîãäà îòâå÷ó Âàì ïîäðîáíî íà Âàøè âîïðîñû. Áîëüøîå Âàì ñïàñèáî çà ëþáîâü è çàáîòó ê Êðèñòèíå. Æåëàþ Âàøåé ñåìüå çäîðîâüÿ. Ñ óâàæåíèåì Íàòàøà è ñåìüÿ!

(follow-up: ↓ 14 ) 07/25/07 06:56:47 changed by aranti..@gmail.com

  • status changed from reopened to closed.
  • resolution set to fixed.

Babelfish says that might translate to something like:

Regards Of bekki, Devid, Maykl, Rossi.Pis'mo your was obtained, but unfortunately I could not transfer in the Russian yazyk.No for the letter to you large of spasibo.Postarayus' him to transfer, and then to otvechu to you it is in detail to your questions. Large to you thanks for the love and the concern for Cristina. I desire to your family of health. With the respect Natasha family!

That doesn't make a lot of sense to me. Automatic translation Russian->English isn't so hot =) Either way, whoever you are anonymous, you're going to have to communicate in English here, to get any sort of response.

(in reply to: ↑ 13 ) 07/25/07 11:38:38 changed by anonymous

Replying to aranti..@gmail.com:

Babelfish says that might translate to something like: Regards Of bekki, Devid, Maykl, Rossi.Pis'mo your was obtained, but unfortunately I could not transfer in the Russian yazyk.No for the letter to you large of spasibo.Postarayus' him to transfer, and then to otvechu to you it is in detail to your questions. Large to you thanks for the love and the concern for Cristina. I desire to your family of health. With the respect Natasha family! That doesn't make a lot of sense to me. Automatic translation Russian->English isn't so hot =) Either way, whoever you are anonymous, you're going to have to communicate in English here, to get any sort of response.

Im live in Russia but im too cant read this message. I think its couse of bad encoding.

07/27/07 04:35:02 changed by anonymous

I had similar problem with Greasemoneky.. its ok now

regards,

http://www.sjz1963.pl/

07/31/07 23:28:59 changed by anonymous

07/31/07 23:57:05 changed by anonymous

08/14/07 18:17:00 changed by anonymous


Add/Change #6 (Wrong (broken) installation of script with russian charsets (in unicode 65001))




Action