Your message dated Thu, 13 Mar 2014 18:41:13 +0100
with message-id <[email protected]>
and subject line Re: Bug#741472: apt-listbugs: broken charset in exported xhtml 
file for certain config
has caused the Debian Bug report #741472,
regarding apt-listbugs: broken charset in exported xhtml file for certain config
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
741472: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=741472
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: apt-listbugs
Version: 0.1.12
Severity: normal
Tags: patch

Dear Maintainer,

with certain config apt-listbugs leads to broken charset in exported xhtml file.
Config is:
export LC_ALL=C LANGUAGE=cs_CZ.UTF-8

This results that chosen po file is po/cs.po, but charset in header is 
"ANSI_X3.4-1968"
(i.e. C).

I'm not an ruby expert, but with this config using Locale.current.charset seems 
to help:
ruby -rgettext -e 'p Locale.charset'
"ANSI_X3.4-1968"
ruby -rgettext -e 'p Locale.current.charset'
"UTF-8"

Best regards,
Petr Vorel

-- System Information:
Debian Release: jessie/sid
  APT prefers unstable
  APT policy: (900, 'unstable'), (500, 'stable'), (100, 'testing'), (50, 
'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 3.13-trunk-amd64 (SMP w/2 CPU cores)
Locale: LANG=cs_CZ.UTF-8, LC_CTYPE=cs_CZ.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages apt-listbugs depends on:
ii  apt                           0.9.15.5+b1
ii  ruby                          1:1.9.3.4
ii  ruby-debian                   0.3.8+b2
ii  ruby-gettext                  3.0.3-2
ii  ruby-httpclient               2.3.3-2
ii  ruby-soap4r                   2.0.5-3
ii  ruby-xmlparser                0.7.2-3
ii  ruby1.9.1 [ruby-interpreter]  1.9.3.484-2

apt-listbugs recommends no packages.

Versions of packages apt-listbugs suggests:
ii  chromium [www-browser]              32.0.1700.123-2
ii  debianutils                         4.4
ii  elinks [www-browser]                0.12~pre6-4
ii  google-chrome-stable [www-browser]  33.0.1750.146-1
ii  iceweasel [www-browser]             24.3.0esr-1
ii  links [www-browser]                 2.8-1+b1
ii  links2 [www-browser]                2.8-1+b1
ii  lynx-cur [www-browser]              2.8.8pre5-1
ii  netsurf-gtk [www-browser]           2.9-2+b1
ii  opera [www-browser]                 12.16.1860
ii  opera-next [www-browser]            12.16.1860
ii  reportbug                           6.5.0
ii  w3m [www-browser]                   0.5.3-15

-- no debconf information
>From 17b9608868ecce851f416518a944314d6ab86973 Mon Sep 17 00:00:00 2001
From: Petr Vorel <[email protected]>
Date: Wed, 12 Mar 2014 21:27:46 +0100
Subject: [PATCH] fix locale bug when locale file is localized, but encoding is
 wrong

Test with
export LC_ALL=C LANGUAGE=cs_CZ.UTF-8
Then texts are from po/cs.po, but charset in header is "ANSI_X3.4-1968"
---
 lib/apt-listbugs/logic.rb | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/apt-listbugs/logic.rb b/lib/apt-listbugs/logic.rb
index d73051c..573b513 100644
--- a/lib/apt-listbugs/logic.rb
+++ b/lib/apt-listbugs/logic.rb
@@ -101,7 +101,7 @@ class AppConfig
 
     @arrow = "->"
     @xarrow = "-&gt;"
-    if Locale.charset == "UTF-8"
+    if Locale.current.charset == "UTF-8"
       @arrow = "→"
       @xarrow = "→"
     end
@@ -649,7 +649,7 @@ class Viewer
     def display_bugs_as_html(bugs, cur_pkgs, new_pkgs)
       tmp = Tempfile.new(["apt-listbugs", ".html"])
       tmp.chmod(0644)
-      tmp.puts "<?xml version=\"1.0\" encoding=\"#{Locale.charset}\"?>"
+      tmp.puts "<?xml version=\"1.0\" encoding=\"#{Locale.current.charset}\"?>"
       tmp.puts "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\""
       tmp.puts "    \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\";>"
       tmp.puts "\n<html xmlns=\"http://www.w3.org/1999/xhtml\";>"
-- 
1.9.0.279.gdc9e3eb


--- End Message ---
--- Begin Message ---
Control: tags -1 - moreinfo patch


On Thu, 13 Mar 2014 07:33:11 +0100 Petr Vorel wrote:

[...]
> > | Note: The variable LANGUAGE is ignored if the locale is set to ‘C’.
> > | In other words, you have to first enable localization, by setting
> > | LANG (or LC_ALL) to a value other than ‘C’, before you can use a
> > | language priority list through the LANGUAGE variable.
> You're right, I have accidentally set LC_ALL=C, which caused the problem. 
> Without that
> it's working.

Good, I am glad you solved your issue.

> 
> I'm sorry for wrong report.

Don't worry, no problem at all!   :-)

I am closing this bug report right now.
Bye and have a nice night!


-- 
 http://www.inventati.org/frx/frx-gpg-key-transition-2010.txt
 New GnuPG key, see the transition document!
..................................................... Francesco Poli .
 GnuPG key fpr == CA01 1147 9CD2 EFDF FB82  3925 3E1C 27E1 1F69 BFFE

Attachment: pgpVi3cOqlAdD.pgp
Description: PGP signature


--- End Message ---

Reply via email to