Closed Bug 705158 Opened 13 years ago Closed 8 years ago

nsIScriptableDateFormat.FormatDateTime raise unknown exceptions under specific locale like zh_TW.UTF-8.

Categories

(Core :: Internationalization, defect)

x86_64
Linux
defect
Not set
normal

Tracking

()

RESOLVED WONTFIX

People

(Reporter: moriramar, Assigned: smontagu)

Details

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:8.0) Gecko/20100101 Firefox/8.0 Build ID: 20111114023917 Steps to reproduce: I ran following code in Venkman: var appLocale = Components.classes["@mozilla.org/intl/nslocaleservice;1"].getService(Components.interfaces.nsILocaleService).getApplicationLocale(); var dateTimeFormat = Components.classes["@mozilla.org/intl/scriptabledateformat;1"].getService(Components.interfaces.nsIScriptableDateFormat); dateTimeFormat.FormatDateTime(appLocale.getCategory("NSILOCALE_TIME"), dateTimeFormat.dateFormatShort , dateTimeFormat.timeFormatNone, 2016, 7, 29, 11, 59, 0) For better look, I rewrite the above code: var Cc = Components.classes; var Ci = Components.interfaces; var appLocale = Cc["@mozilla.org/intl/nslocaleservice;1"].getService(Ci.nsILocaleService).getApplicationLocale(); var dateTimeFormat = Cc["@mozilla.org/intl/scriptabledateformat;1"].getService(Ci.nsIScriptableDateFormat); dateTimeFormat.FormatDateTime(appLocale.getCategory("NSILOCALE_TIME"), dateTimeFormat.dateFormatShort , dateTimeFormat.timeFormatNone, 2016, 7, 29, 11, 59, 0) Actual results: [Exception... "Component returned failure code: 0x8050000e [nsIScriptableDateFormat.FormatDateTime]" nsresult: "0x8050000e (<unknown>)" location: "JS frame :: chrome://venkman/content/venkman-eval.js :: con_eval :: line 52" data: no] Expected results: I might get something like "07/29/2016".
System information: Portage 2.1.10.37 (hardened/linux/amd64/desktop, gcc-4.5.3, glibc-2.13-r4, 3.1.1-hardened x86_64) ================================================================= System uname: Linux-3.1.1-hardened-x86_64-AMD_Athlon-tm-_II_Neo_K345_Dual-Core_Processor-with-gentoo-2.1 Timestamp of tree: Thu, 24 Nov 2011 11:30:01 +0000 app-shells/bash: 4.2_p10 dev-lang/python: 2.7.2-r3, 3.2.2 dev-util/cmake: 2.8.6-r3 dev-util/pkgconfig: 0.26 sys-apps/baselayout: 2.1 sys-apps/openrc: 0.9.4 sys-apps/sandbox: 2.5 sys-devel/autoconf: 2.13, 2.68 sys-devel/automake: 1.9.6-r3, 1.10.3, 1.11.1-r1 sys-devel/binutils: 2.22 sys-devel/gcc: 4.5.3-r1 sys-devel/gcc-config: 1.5-r2 sys-devel/libtool: 2.4.2 sys-devel/make: 3.82-r3 sys-kernel/linux-headers: 2.6.39 (virtual/os-headers) sys-libs/glibc: 2.13-r4 Repositories: gentoo sunrise science gentoo-zh gentoo-haskell local ACCEPT_KEYWORDS="amd64 ~amd64" ACCEPT_LICENSE="* -@EULA google-talkplugin skype-eula" CBUILD="x86_64-pc-linux-gnu" CFLAGS="-march=native -O2 -pipe" CHOST="x86_64-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt /usr/share/openvpn/easy-rsa" CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c" CXXFLAGS="-march=native -O2 -pipe" DISTDIR="/var/cache/portage/distfiles" EMERGE_DEFAULT_OPTS="--with-bdeps=y" FEATURES="assume-digests binpkg-logs distlocks ebuild-locks fixlafiles news parallel-fetch protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch" FFLAGS="" GENTOO_MIRRORS="http://gentoo.cites.uiuc.edu/pub/gentoo" LANG="en_US.UTF-8" LDFLAGS="-Wl,-O1 -Wl,--as-needed" LINGUAS="zh_TW zh" MAKEOPTS="-j2" PKGDIR="/var/cache/portage/packages" PORTAGE_CONFIGROOT="/" PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/var/lib/ebuilds/portage" PORTDIR_OVERLAY="/var/lib/ebuilds/sunrise /var/lib/ebuilds/science /var/lib/ebuilds/gentoo-zh /var/lib/ebuilds/haskell /var/lib/ebuilds/local" SYNC="rsync://rsync.gentoo.org/gentoo-portage" USE="X a52 aac acl acpi amd64 avahi bash-completion berkdb bluetooth branding bzip2 cairo cdda cdr cjk cli consolekit cracklib crypt cups cxx dbus djvu dri dts dvd dvdr emboss encode exif fam ffmpeg firefox flac gconf gdbm gdu gif gnome gnome-keyring gpm gstreamer gtk hardened iconv ipv6 jpeg jpeg2k justify lame lcms ldap libnotify mad mms mmx mmxext mng modules mp3 mp4 mpeg msn mudflap multilib nautilus ncurses nls nptl nptlonly nsplugin ogg opengl openmp pam pango pax_kernel pcre pdf perl png policykit ppds pppd pulseaudio python readline samba sdl session spell sqlite sse sse2 ssl startup-notification svg sysfs system-sqlite taglib tcpd threads tiff truetype udev unicode upnp urandom usb v4l vaapi vim-syntax vorbis webkit wifi x264 xcb xcomposite xinerama xml xorg xulrunner xv xvid xvmc zlib" ALSA_CARDS="hda-intel" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="kexi words flow plan stage tables krita karbon braindump" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" DRACUT_MODULES="crypt crypt-gpg syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" INPUT_DEVICES="evdev keyboard mouse synaptics" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="zh_TW zh" PHP_TARGETS="php5-3" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="radeon" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account" Unset: CPPFLAGS, CTARGET, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
I encounter this problem when using Enigmail under zh_TW.UTF-8, which fails to show keys in "Key management" window. Here are some other texts in the interactive session of Venkman: < 00029: Components.classes["@mozilla.org/intl/nslocaleservice;1"].getService(Components.interfaces.nsILocaleService).getApplicationLocale().getCategory("NSILOCALE_TIME") > zh-TW < 00031: var dateTimeFormat = Components.classes["@mozilla.org/intl/scriptabledateformat;1"].getService(Components.interfaces.nsIScriptableDateFormat); dateTimeFormat.FormatDateTime("zh-TW", dateTimeFormat.dateFormatShort , dateTimeFormat.timeFormatNone, 2016, 7, 29, 11, 59, 0) !! [Exception... "Component returned failure code: 0x8050000e [nsIScriptableDateFormat.FormatDateTime]" nsresult: "0x8050000e (<unknown>)" location: "JS frame :: chrome://venkman/content/venkman-eval.js :: con_eval :: line 52" data: no] < 00032: var dateTimeFormat = Components.classes["@mozilla.org/intl/scriptabledateformat;1"].getService(Components.interfaces.nsIScriptableDateFormat); dateTimeFormat.FormatDateTime("en-US", dateTimeFormat.dateFormatShort , dateTimeFormat.timeFormatNone, 2016, 7, 29, 11, 59, 0) > 07/29/2016 The problem can be reproduced under ja_JP.UTF-8, ko_KR.UTF-8, zh_CN.UTF-8 and ar_LY.UTF-8, but cannot be found under en_US.UTF-8, en_US.iso88591, it_IT.UTF-8, it_IT.iso88591, ja_JP.eucjp, ko_KR.euckr, zh_CN.GB18030, zh_TW.BIG5 and ar_LY.iso88596.
Oh, I forget to put following information: $ ls -l /etc/locale.gen lrwxrwxrwx 1 root root 25 May 8 2011 /etc/locale.gen -> /usr/share/i18n/SUPPORTED I ran locale-gen.
Assignee: nobody → smontagu
Component: General → Internationalization
Product: Thunderbird → Core
QA Contact: general → i18n
Version: 8 → Trunk
nsIScriptableDateFormat is removed by bug 1313625
Status: UNCONFIRMED → RESOLVED
Closed: 8 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.