Skip Menu |
 

This queue is for tickets about the Text-BibTeX CPAN distribution.

Report information
The Basics
Id: 115434
Status: resolved
Priority: 0/
Queue: Text-BibTeX

People
Owner: Nobody in particular
Requestors: pipping.elias [...] icloud.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Document how to handle UTF-8 in bibtex files
Date: Sat, 18 Jun 2016 23:22:36 +0200
To: bug-Text-BibTeX [...] rt.cpan.org
From: Elias Pipping <pipping.elias [...] icloud.com>
Hi, I’ve been using Text::BibTeX for quite a while now and it’s been serving me very well. Thank you for making that possible! Until earlier today I was using Text::BibTeX::purify_string to sanitise anything that was written to standard output. Now I wanted to print UTF-8 encoded strings, including some that were already in the bibtex file I was reading. It took me quite a while to get that right: Since Text::BibTeX::File::open() hands all its arguments over to IO::File and that class accepts a second argument “<:encoding(UTF-8)” to make it treat its input as UTF-8, I expected to be able to pass “<:encoding(UTF-8)” as the second argument to Text::BibTeX::File::open(). To do so was in fact possible, but did not seem to have any effect. In the end, by looking at the source (in particular the test suite), I found out about Encode::decode_utf8, which allowed me to make things work. It would be nice if that was mentioned somewhere in the documentation of Text::BibTeX::File, assuming it’s the right solution. Best, Elias
Download (untitled) / with headers
text/plain 1.2k
On Sat Jun 18 17:22:51 2016, pipping.elias@icloud.com wrote: Show quoted text
> Hi, > > I’ve been using Text::BibTeX for quite a while now and it’s been > serving me very well. Thank you for making that possible! Until > earlier today I was using Text::BibTeX::purify_string to sanitise > anything that was written to standard output. Now I wanted to print > UTF-8 encoded strings, including some that were already in the bibtex > file I was reading. It took me quite a while to get that right: Since > Text::BibTeX::File::open() hands all its arguments over to IO::File > and that class accepts a second argument “<:encoding(UTF-8)” to make > it treat its input as UTF-8, I expected to be able to pass > “<:encoding(UTF-8)” as the second argument to > Text::BibTeX::File::open(). To do so was in fact possible, but did not > seem to have any effect. > > In the end, by looking at the source (in particular the test suite), I > found out about Encode::decode_utf8, which allowed me to make things > work. It would be nice if that was mentioned somewhere in the > documentation of Text::BibTeX::File, assuming it’s the right solution.
By pure coincidence, we are working on that. You can check https://github.com/ambs/Text-BibTeX/tree/utf8 but still not stable :) Thnks
Download (untitled) / with headers
text/plain 1.2k
Hi, 0.75_01 should be hitting CPAN. use Text::BibTeX::File->open(file, { binmode => 'utf-8' }) Thanks On Sat Jun 18 17:22:51 2016, pipping.elias@icloud.com wrote: Show quoted text
> Hi, > > I’ve been using Text::BibTeX for quite a while now and it’s been > serving me very well. Thank you for making that possible! Until > earlier today I was using Text::BibTeX::purify_string to sanitise > anything that was written to standard output. Now I wanted to print > UTF-8 encoded strings, including some that were already in the bibtex > file I was reading. It took me quite a while to get that right: Since > Text::BibTeX::File::open() hands all its arguments over to IO::File > and that class accepts a second argument “<:encoding(UTF-8)” to make > it treat its input as UTF-8, I expected to be able to pass > “<:encoding(UTF-8)” as the second argument to > Text::BibTeX::File::open(). To do so was in fact possible, but did not > seem to have any effect. > > In the end, by looking at the source (in particular the test suite), I > found out about Encode::decode_utf8, which allowed me to make things > work. It would be nice if that was mentioned somewhere in the > documentation of Text::BibTeX::File, assuming it’s the right solution. > > > Best, Elias
Subject: Re: [rt.cpan.org #115434] Document how to handle UTF-8 in bibtex files
Date: Sat, 25 Jun 2016 00:29:37 +0200
To: bug-Text-BibTeX [...] rt.cpan.org
From: Elias Pipping <pipping.elias [...] icloud.com>
Download (untitled) / with headers
text/plain 409b
Show quoted text
> On 24 Jun 2016, at 21:59, Alberto Simões via RT <bug-Text-BibTeX@rt.cpan.org> wrote: > > <URL: https://rt.cpan.org/Ticket/Display.html?id=115434 > > > Hi, > > 0.75_01 should be hitting CPAN. > use > > Text::BibTeX::File->open(file, { binmode => 'utf-8' }) > > Thanks
This is great! Works like a charm, too (after addressing [1]). Thanks :) Elias [1] https://github.com/ambs/Text-BibTeX/issues/10
Download (untitled) / with headers
text/plain 540b
On Fri Jun 24 18:29:49 2016, pipping.elias@icloud.com wrote: Show quoted text
>
> > On 24 Jun 2016, at 21:59, Alberto Simões via RT <bug-Text- > > BibTeX@rt.cpan.org> wrote: > > > > <URL: https://rt.cpan.org/Ticket/Display.html?id=115434 > > > > > Hi, > > > > 0.75_01 should be hitting CPAN. > > use > > > > Text::BibTeX::File->open(file, { binmode => 'utf-8' }) > > > > Thanks
> > This is great! Works like a charm, too (after addressing [1]). Thanks > :) > > > > Elias > > [1] https://github.com/ambs/Text-BibTeX/issues/10
Marked as fixed. Thanks


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.