Comments (9)
Could you show an example of the code which broke, please?
from pithub.
For example, following code shows the title of shogo82148/wikitest#1
use warnings;
use strict;
use utf8;
use Encode;
use Pithub;
binmode(STDOUT, ":utf8");
my $pr = Pithub->new->pull_requests->get(
user => 'shogo82148',
repo => 'wikitest',
pull_request_id => 1,
)->content;
my $title = decode_utf8($pr->{title});
print "$title\n";
It works with [email protected]
$ perl pithub.pl
add 申 and 月
but, it doesn't work with [email protected]
$ perl pithub.pl
Cannot decode string with wide characters at /home/ichinose/.plenv/versions/5.20.2/lib/perl5/5.20.2/x86_64-linux/Encode.pm line 215.
from pithub.
This would be the commit which changed the behaviour: 13e5302
@shogo82148 if you remove the decode_utf8
call, does that solve the issue for you?
from pithub.
if you remove the decode_utf8 call, does that solve the issue for you?
yes. it is very simple example, so it is very easy to remove extra decode_utf8
and add missing encode_utf8
.
But my code is too large to be resolved in this way.
I want a compatibility option. For example,
Pithub->new->utf8(0); # disable utf8 en/de-coding (default)
Pithub->new->utf8(1); # enable utf8 en/de-coding
from pithub.
That seems reasonable to me. Anyone else have an opinion on this? I'd like to see the decoding on by default, but if we consider this a breaking change (which it is in your case) then having it off by default makes sense too.
from pithub.
I would prefer UTF8 was on by default. UTF8 is more and more the norm. We should take the compatibility hit.
from pithub.
@shogo82148 Would you like to send a pull request implementing what you've described above, but with UTF8 on rather than off by default?
from pithub.
@oalders I will.
I would prefer UTF8 was on by default.
I agree about UTF-8 on by default. but I also want to UTF-8 off by option.
from pithub.
@shogo82148 I think we're all in agreement then. If you could put this together, that would be great!
from pithub.
Related Issues (20)
- Turn on coveralls.io HOT 2
- Allow passing attributes to Pithub instance helpers HOT 1
- Ability to delete repositories
- Add the ability to get a branch
- New release? HOT 5
- Pithub-0.01027 unchecked dependency on Moo-1.006001 HOT 1
- No way to pull issues by milestone title HOT 5
- Need more examples in the SYNOPSIS of main module HOT 1
- Test Failures / Modification of non-creatable hash value attempted, subscript "bio" HOT 3
- ->issues HOT 4
- ->commits HOT 5
- ->pull_requests HOT 2
- Feature Request: Markdown HOT 7
- Feature: method to query rate_limit HOT 1
- Problem with POD generation HOT 2
- Failures due to JSON deps HOT 2
- Fix Pod errors in Pithub::Base HOT 1
- Drop dependency on Array::Iterator HOT 2
- Github requires boolean values for true/false values not 0/1 HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pithub.