Mobiles and macs
My sister is a mac user (a relatively recent convert), running her own business. She is reviewing her current mobile phone contract and model. Ideally she wants a phone that can sync her diary and contacts from the mac, but all the models she has found seem to be geared towards Windoze lookout. She wants to be mobile with full email and calendar facilities. Can anybody recommend a solution? Even the helpful guy in the Apple shop was struggling with this one. Cheers, Ivor.
Re: London.pm Dim sum Thursday 1pm: Golden Pagoda
2008/9/10 Léon Brocard [EMAIL PROTECTED]: It's time for a new restaurant this week. I understand that Wai Sui Yu, the dim sum chef from Dragon Castle that we've been to in the past and found quite tasty, is now at Golden Pagoda in Chinatown. So let's go. Golden Pagoda Thursday 1pm 15a Gerrard St, Chinatown, W1D 6JD http://maps.google.co.uk/maps?q=W1D6JD http://www.timeout.com/london/restaurants/reviews/10643.html This is today! Who's coming? Léon
Re: Mobiles and macs
At 8:08 AM +0100 9/11/08, IvorW wrote: My sister is a mac user (a relatively recent convert), running her own business. She is reviewing her current mobile phone contract and model. Ideally she wants a phone that can sync her diary and contacts from the mac, but all the models she has found seem to be geared towards Windoze lookout. She wants to be mobile with full email and calendar facilities. Can anybody recommend a solution? Even the helpful guy in the Apple shop was struggling with this one. They don't do iPhone in the UK? Liz
Re: Mobiles and macs
On Thu, Sep 11, 2008 at 12:08 AM, IvorW [EMAIL PROTECTED] wrote: My sister is a mac user (a relatively recent convert), running her own business. She is reviewing her current mobile phone contract and model. Ideally she wants a phone that can sync her diary and contacts from the mac, but all the models she has found seem to be geared towards Windoze lookout. She wants to be mobile with full email and calendar facilities. Can anybody recommend a solution? Even the helpful guy in the Apple shop was struggling with this one. iPhone? Blackberry sponsors a Mac-native app that supports all of the Apple tools (iCal, Mail, Sticky Notes), as well as tools from other vendors (MeetingMaker comes to mind). It's called PocketSync, and it's available from the RIM/Blackberry website. Thanks, Brian
Re: Mobiles and macs
Simplest solution, an iPhone. Otherwise, http://markspace.com/ ... Mac sync clients for Symbian, Windows Mobile, Blackberry and Palm. Which should cover all the available phones out there :) Dj On 11 Sep 2008, at 08:08, IvorW wrote: My sister is a mac user (a relatively recent convert), running her own business. She is reviewing her current mobile phone contract and model. Ideally she wants a phone that can sync her diary and contacts from the mac, but all the models she has found seem to be geared towards Windoze lookout. She wants to be mobile with full email and calendar facilities. Can anybody recommend a solution? Even the helpful guy in the Apple shop was struggling with this one. Cheers, Ivor. Dj Walker-Morgan - Open Source Editor [EMAIL PROTECTED]
Re: Mobiles and macs
Hi IvorW, The iPhone is an obvious choice here. There are many tweaks that can be made to integrate nicely with her current email address. For painlessness-sake, this would be choice 1. The TREOs from Palm have their own version of calendar if my memory serves me well, so would not be exactly spot on. Yet it could be possible. When it comes to integration with iCal, it can be quite tricky but with the use of spanningsync, you could use any phone that can work with google apps(a fine choice for small businesses) Hope this helps, Livio
Re: Mobiles and macs
Ah, this should help: http://www.apple.com/macosx/features/isync And from this page I found: http://www.markspace.com/ So now you have a choice. Livio
Re: Mobiles and macs
On 11 Sep 2008, at 08:08, IvorW wrote: My sister is a mac user (a relatively recent convert), running her own business. She is reviewing her current mobile phone contract and model. Ideally she wants a phone that can sync her diary and contacts from the mac, but all the models she has found seem to be geared towards Windoze lookout. She wants to be mobile with full email and calendar facilities. Can anybody recommend a solution? Even the helpful guy in the Apple shop was struggling with this one. I have the Ericsson C902. I needed to spend a couple of bucks on a third-party script to get it fully working, but now it does everything you ask for. -- Dave HodgkinsonMSN: [EMAIL PROTECTED] Site: http://www.davehodgkinson.com UK: +44 7768 49020 Blog: http://davehodg.blogspot.comNL: +31 654 982906 Photos: http://www.flickr.com/photos/davehodg
Re: Mobiles and macs
Dj Walker-Morgan wrote: Simplest solution, an iPhone. Otherwise, http://markspace.com/ ... Mac sync clients for Symbian, Windows Mobile, Blackberry and Palm. Which should cover all the available phones out there :) Thank you! Markspace looks interesting. I'll pass this on.
Re: Mobiles and macs
On 11 Sep 2008, at 08:08, IvorW wrote: My sister is a mac user (a relatively recent convert), running her own business. She is reviewing her current mobile phone contract and model. Ideally she wants a phone that can sync her diary and contacts from the mac, but all the models she has found seem to be geared towards Windoze lookout. She wants to be mobile with full email and calendar facilities. Can anybody recommend a solution? Even the helpful guy in the Apple shop was struggling with this one. I had a Vario II for a while, which worked great (apart from the size!) and you can get the mac syncing stuff from http://www.markspace.com/ I regularly used it as a bluetooth modem also (despite T-mobile telling me it won't work with a Mac! ;-) I now have a Nokia E51 which does all of the above (Nokia has a mac download from their site for syncing photos/music/files). And it looks nice and thin also! :-) cheers adam
Re: Mobiles and macs
7 years of macs and sony ericsson phones, not a single complaint: address book and ical sync'ing, bluetooth dialing and texting, bluetooth modem, etc. the k or t series are the best, imo, although i might have to go for a shiny c905 next april :) cheers, pedro -- http://pedrofigueiredo.org/ you don't code php. you merely edit it until it works. - merlyn
Re: [OT] select and sysread problem on solaris
On Thu, Sep 11, 2008 at 02:36:55AM +0100, Andy Armstrong wrote: On 11 Sep 2008, at 02:12, Paul Johnson wrote: Is my assumption correct that if select tells you there is something to be read then there should be something there to be read? Can anyone think of any other possibilities? 210 + ~30 = ~240 - which is getting close to 255. Since select uses a fixed bit field to represent filenos there's an upper limit on the filenos you can select on. What does this print? #include sys/select.h #include stdio.h int main( void ) { printf( %d\n, FD_SETSIZE ); return 0; } Hi Andy, Thanks for thinking about this. The output is 1024, but I'm not convinced the problem lies in this area. The numbers I gave are a little inaccurate (I was trying to remember off the top of my head early in the morning). There were previously 343 named pipes being monitored, and there will now be about 60 more. These are split between three processes, so each one will be selecting over about 135 pipes. As you see, this should be covered and, in addition, I am using PERLIO=perlio so that Perl's own IO implementation is being used, allowing 1024 files to be opened per process, rather than the 256 which would be allowed with Solaris' stdio implementation. We have just moved from under 128 files per select to just over, but I don't think this is the problem. Additionally, the system will seem to work fine for many Gb of data before this problem is (seemingly randonly) triggered. Thanks again for your hint. Do you (or anyone else) have any more? (I know you'd all rather talk about macs and mobiles.) -- Paul Johnson - [EMAIL PROTECTED] http://www.pjcj.net
Re: [OT] select and sysread problem on solaris
On 11 Sep 2008, at 02:12, Paul Johnson wrote: I'm looking for a little help in solving a problem which has me stumped and couldn't think of anywhere better to come. That's not the problem by the way, but I'll take answers to that as well. I have about 210 named pipes (FIFOs) and three processes which are running a select over a third of the pipes each, and then calling sysread on the pipe before writing out the data to log files. This has been working well in production for almost two years handling many GB of data daily. Recently, another thirty or so pipes have been added to this group and very occassionally I am noticing a problem whereby select will indicate that a pipe is ready for reading and sysread will attempt to read from the pipe, but there is actually nothing there to be read, and so the sysread call hangs waiting for input. Reproducing this problem is difficult, but I currently have the system in such a state. The pipe on which the sysread call is waiting is one of the new pipes. I can only think of four possible explanations here: 1. My code is broken. I don't think this is the case but don't want to rule it out. 2. Some other process has read the data inbetween the select returning and the sysread being called. lsof shows no unexpected processes accessing the pipe at the moment and no one should have been on the system to have run cat or anything. last shows nothing suspicious. 3. Perl's select is broken. 4. The OS broken. Is my assumption correct that if select tells you there is something to be read then there should be something there to be read? Can anyone think of any other possibilities? What is curious to me is that the process writing to the named pipe is hung. Is the pipe locked somehow until the sysread call has returned? Unless I can think of anything better to do, tomorrow I will try to send some data to the named pipe that is being read to see if that will allow the sysread to return. If it does, I should be able to tell whether any data has been lost from the named pipe, which might indicate that another process had read it. I am running perl-5.8.8 on Solaris 8. The program writing to named pipe is a Java program which is writing to STDOUT. That program has been called using system by a Perl wrapper which has reopened STDOUT to the named pipe. The program reading from the named pipe is using PERLIO. I'm open to any hints, suggestions or solutions. This reminds of a issue I found with select/sysread on solaris too, although it turned out it was a misunderstanding on my part of the perl sysread semantics compared to the read system call. It was something to do with what happened when a pipe was closed unexpectedly I think. You might review the docs on sysread and select, but I'm sure you've done that already. the perl select docs also suggest you use the O_NONBLOCK flag for the case you're referring to as well. Sorry, but that's all I can offer without doing any serious research. - Mark
Re: [OT] select and sysread problem on solaris
Hi Paul, As you see, this should be covered and, in addition, I am using PERLIO=perlio so that Perl's own IO implementation is being used, allowing 1024 files to be opened per process, rather than the 256 which would be allowed with Solaris' stdio implementation. Maybe you're suffering from buffering[1] between the two IO implementations. Have you tried selecting STDOUT and flushing it? Maybe it is blocking on some left over data? Something like: $| = 1 on the select-ed filehandle will flush it. One other thing to check is the bytesize and character encoding of things you are reading off the network - just to make sure there are no left over bytes in the pipes. Also are you doing slurping reads? Make sure nothing has messed with the end of line $/ characters. If you are tracing what's happening sometimes your own trace writes can bizarrely interact with IO buffers etc. I had to debug a similar problem and when I put the trace in it blocked and when I removed the trace it worked!? Try turning tracing off and see if it makes a difference. A final suggestion would be to not mix IO layers. Good luck - this sounds like a nasty one. ;-) Nige [1] http://perl.plover.com/FAQs/Buffering.html [2] Network Programming with Perl is a brilliant book for this sort of thing
Re: [OT] select and sysread problem on solaris
* Paul Johnson ([EMAIL PROTECTED]) [080911 09:20]: On Thu, Sep 11, 2008 at 02:36:55AM +0100, Andy Armstrong wrote: printf( %d\n, FD_SETSIZE ); The output is 1024, but I'm not convinced the problem lies in this area. See http://blogs.sun.com/elving/entry/too_many_open_files Do you have perl compiled as 32bit or 64bit? It wouldn't wonder me if Solaris lied to Perl about the max number of file-descriptors. We have just moved from under 128 files per select to just over, but I don't think this is the problem. Additionally, the system will seem to work fine for many Gb of data before this problem is (seemingly randonly) triggered. Clients address your service via sockets which count as file-descriptors as well. It is not only a limit on what you can pass with select(): the whole sum of pipes and sockets over all threads within one process can not exceed 256. (At least, that is my interpretation of the docs) -- Regards, MarkOv Mark Overmeer MScMARKOV Solutions [EMAIL PROTECTED] [EMAIL PROTECTED] http://Mark.Overmeer.net http://solutions.overmeer.net
Re: [OT] select and sysread problem on solaris
Mark Blackman wrote: On 11 Sep 2008, at 02:12, Paul Johnson wrote: Recently, another thirty or so pipes have been added to this group and very occassionally I am noticing a problem whereby select will indicate that a pipe is ready for reading and sysread will attempt to read from the pipe, but there is actually nothing there to be read, and so the sysread call hangs waiting for input. the perl select docs also suggest you use the O_NONBLOCK flag for the case you're referring to as well. Select(), on any platform, *may* return an indication that there is data to read when there isn't. Therefore using blocking reads with select() *will* fail, at some point, in the manner that you describe. The busier the system, the more likely it is to occur. Any tutorial on the use of select() should really mandate the use of O_NONBLOCK so that one can capture the EAGAIN/EWOULDBLOCK/EINPROGRESS error(s) and then ignore them. If your sysread returns UNDEF, then check for these errors in $! and just carry on, otherwise signal EOF in the normal way. Dirk
Re: [OT] select and sysread problem on solaris
On Thu, Sep 11, 2008 at 12:23:39PM +0200, Mark Overmeer wrote: [...] Clients address your service via sockets which count as file-descriptors as well. It is not only a limit on what you can pass with select(): the whole sum of pipes and sockets over all threads within one process can not exceed 256. (At least, that is my interpretation of the docs) The clients are presumably in a different process, otherwise why would one bother with IPC in the first place? The system-wide limit on open file descriptors is possibly worth checking though.
Re: [OT] select and sysread problem on solaris
Paul Johnson wrote: Recently, another thirty or so pipes have been added to this group and very occassionally I am noticing a problem whereby select will indicate that a pipe is ready for reading and sysread will attempt to read from the pipe, but there is actually nothing there to be read, and so the sysread call hangs waiting for input. Could it be a deferred signal? See perldoc perlipc for more info. From some code I wrote: while (1) { $client = $server-accept() || do { # accept() can fail in Perl 5.7.3 and later thanks # to safe signals which can interrupt an accept() # so we detect this and ignore it next if $!{EINTR}; last; }; # handle $client request } It's not using select(), but it could be a manifestation of the same issue. HTH A
Re: Mobiles and macs
On Thu, Sep 11, 2008 at 08:19:29AM +0100, Dj Walker-Morgan wrote: Simplest solution, an iPhone. Otherwise, http://markspace.com/ ... Mac sync clients for Symbian, Windows Mobile, Blackberry and Palm. Which should cover all the available phones out there :) Completely unnecessary for PalmOS, which comes with a Mac desktop thingy. -- David Cantrell | London Perl Mongers Deputy Chief Heretic There's no problem so complex that it can't be solved by killing everyone even remotely associated with it
Re: Mobiles and macs
On Thu, Sep 11, 2008 at 11:45:38AM +0100, David Cantrell wrote: [...] Completely unnecessary for PalmOS, which comes with a Mac desktop thingy. iSync also knows how to remote-control the Palm desktop sync tool if one prefers to use the Apple address book and calendaring tools.
Re: [OT] select and sysread problem on solaris
* Dirk Koopman ([EMAIL PROTECTED]) [080911 10:25]: Any tutorial on the use of select() should really mandate the use of O_NONBLOCK so that one can capture the EAGAIN/EWOULDBLOCK/EINPROGRESS error(s) and then ignore them. If your sysread returns UNDEF, then check for these errors in $! and just carry on, otherwise signal EOF in the normal way. IO::Multiplex (by coincedence also discussed for other reasons on perl5-porters today) is a nice example implementation for this problem. -- MarkOv Mark Overmeer MScMARKOV Solutions [EMAIL PROTECTED] [EMAIL PROTECTED] http://Mark.Overmeer.net http://solutions.overmeer.net
Re: Mobiles and macs
On 11 Sep 2008, at 11:45, David Cantrell wrote: On Thu, Sep 11, 2008 at 08:19:29AM +0100, Dj Walker-Morgan wrote: Simplest solution, an iPhone. Otherwise, http://markspace.com/ ... Mac sync clients for Symbian, Windows Mobile, Blackberry and Palm. Which should cover all the available phones out there :) Completely unnecessary for PalmOS, which comes with a Mac desktop thingy. Well it would be unnecessary if the PalmOS offering worked right. When I was using a Treo I ended up forking out for the MarkSpace sync tools which, once set up, didn't randomly duplicate, delete and change entries quite so frequently. And then I joined the cult of the iPhone... Nigel. -- [ Nigel Metheringham [EMAIL PROTECTED] ] [ - Comments in this message are my own and not ITO opinion/policy - ]
Re: Mobiles and macs
On 11 Sep 2008, at 11:45, David Cantrell wrote: On Thu, Sep 11, 2008 at 08:19:29AM +0100, Dj Walker-Morgan wrote: Simplest solution, an iPhone. Otherwise, http://markspace.com/ ... Mac sync clients for Symbian, Windows Mobile, Blackberry and Palm. Which should cover all the available phones out there :) Completely unnecessary for PalmOS, which comes with a Mac desktop thingy. Last version was 4.2.1 it synchronised with itself, not the native desktop applications. And on Intel Macs it runs in Rosetta mode as it is a PPC application. The MarkSpace stuff is Universal and in my experience more reliable and with syncing... oh you want the reliability. Nothing worse than leaving in the morning and finding an empty contacts database in your phone. It's not cheap, but Dj Dj Walker-Morgan - Open Source Editor [EMAIL PROTECTED]
Re: Mobiles and macs
On Thu, Sep 11, 2008 at 11:53:03AM +0100, Nigel Metheringham wrote: On 11 Sep 2008, at 11:45, David Cantrell wrote: Completely unnecessary for PalmOS, which comes with a Mac desktop thingy. Well it would be unnecessary if the PalmOS offering worked right. When I was using a Treo I ended up forking out for the MarkSpace sync tools which, once set up, didn't randomly duplicate, delete and change entries quite so frequently. I wonder what you were doing wrong. -- David Cantrell | A machine for turning tea into grumpiness Eye have a spelling chequer / It came with my pea sea It planely marques four my revue / Miss Steaks eye kin knot sea. Eye strike a quay and type a word / And weight for it to say Weather eye am wrong oar write / It shows me strait a weigh.
Is -C useless?
Consider the following: #!/usr/bin/perl -COL print Hello w\xe9rld\n; $ perl test.pl Too late for -COL option at test.pl line 1. WTF?? If that's too late, where else can I put it? If I remove it from the file: $ perl -COL test.pl Hello wérld But of course now STDOUT isn't UTF-8. $ perl test.pl Hello w�ld This can be fixed by: #!/usr/bin/perl binmode STDOUT, :utf8 if $ENV{LANG} =~ m/\.UTF-8$/; print Hello w\xe9rld\n; $ perl test.pl Hello wérld But of course, this is the exact behaviour that -COL is supposed to provide; and yet is too late by the shebang time.. Yet, clearly not because I can do it even later at runtime. Can anyone offer any insight here? -- Paul LeoNerd Evans [EMAIL PROTECTED] ICQ# 4135350 | Registered Linux# 179460 http://www.leonerd.org.uk/ signature.asc Description: PGP signature
Re: Is -C useless?
On Thu, 2008-09-11 at 13:11 +0100, Paul LeoNerd Evans wrote: Consider the following: #!/usr/bin/perl -COL print Hello w\xe9rld\n; $ perl test.pl Too late for -COL option at test.pl line 1. WTF?? If that's too late, where else can I put it? If I remove it from the file: $ perl -COL test.pl Hello wérld But of course now STDOUT isn't UTF-8. $ perl test.pl Hello w�ld This can be fixed by: #!/usr/bin/perl binmode STDOUT, :utf8 if $ENV{LANG} =~ m/\.UTF-8$/; print Hello w\xe9rld\n; $ perl test.pl Hello wérld But of course, this is the exact behaviour that -COL is supposed to provide; and yet is too late by the shebang time.. Yet, clearly not because I can do it even later at runtime. Can anyone offer any insight here? Maybe: chmod 755 test.pl ./test.pl ?
Re: Is -C useless?
Paul LeoNerd Evans wrote: Consider the following: #!/usr/bin/perl -COL print Hello w\xe9rld\n; $ perl test.pl Too late for -COL option at test.pl line 1. Ermmm... that's because by the time you get to the -COL switch you're already inside the perl interpreter that you called from the command line I think you meant $ chmod 755 test.pl $ ./test.pl Which gives me the output you want : Hello wérld Unless I've missed something, which is highly likely regards, Paul -- Paul Orrock Digital Craftsmen Lead SysAdmin www.digitalcraftsmen.net Exmouth House, 3 Pine Street, London, EC1R 0JH Tel: 020 7183 1410 Fax: 020 7099 5140
Re: Is -C useless?
On Thu, Sep 11, 2008 at 01:52:31PM +0100, Paul LeoNerd Evans wrote: By the way, this is perl 5.10. I think it used to work on 5.8.8. For some value of work which was actually silently fail Nicholas Clark
Re: Is -C useless?
On Thu, 11 Sep 2008 13:24:34 +0100 Paul Orrock [EMAIL PROTECTED] wrote: $ chmod 755 test.pl $ ./test.pl Which gives me the output you want : Hello wérld Unless I've missed something, which is highly likely $ ll test.pl -rwxr-xr-x 1 leo leo 48 2008-09-11 13:51 test.pl $ cat test.pl #!/usr/bin/perl -COL print Hello w\xe9rld\n; $ ./test.pl Too late for -COL option at ./test.pl line 1. By the way, this is perl 5.10. I think it used to work on 5.8.8. Perl version? -- Paul LeoNerd Evans [EMAIL PROTECTED] ICQ# 4135350 | Registered Linux# 179460 http://www.leonerd.org.uk/ signature.asc Description: PGP signature
Re: Is -C useless?
On Thu, Sep 11, 2008 at 01:52:31PM +0100, Paul LeoNerd Evans wrote: On Thu, 11 Sep 2008 13:24:34 +0100 Paul Orrock [EMAIL PROTECTED] wrote: $ chmod 755 test.pl $ ./test.pl Which gives me the output you want : Hello wérld Unless I've missed something, which is highly likely $ ll test.pl -rwxr-xr-x 1 leo leo 48 2008-09-11 13:51 test.pl $ cat test.pl #!/usr/bin/perl -COL print Hello w\xe9rld\n; $ ./test.pl Too late for -COL option at ./test.pl line 1. By the way, this is perl 5.10. I think it used to work on 5.8.8. Ah, then you'll have read pod/perl5100delta.pod. The B-C option can no longer be used on the C#! line. It wasn't working there anyway, since the standard streams are already set up at this point in the execution of the perl interpreter. You can use binmode() instead to get the desired behaviour. Which is just what you seem to have discovered ;-) -- Paul Johnson - [EMAIL PROTECTED] http://www.pjcj.net
Re: Mobiles and macs
On Thu, 11 Sep 2008, David Cantrell wrote: On Thu, Sep 11, 2008 at 11:53:03AM +0100, Nigel Metheringham wrote: On 11 Sep 2008, at 11:45, David Cantrell wrote: Completely unnecessary for PalmOS, which comes with a Mac desktop thingy. Well it would be unnecessary if the PalmOS offering worked right. When I was using a Treo I ended up forking out for the MarkSpace sync tools which, once set up, didn't randomly duplicate, delete and change entries quite so frequently. I wonder what you were doing wrong. It can be a royal pain in the butt to set up right if you've never done it before, or can't ferret out the procedure on Apple's support site. And even if you do get it working, it's surprisingly brittle. (I've had to help a lot of people get it working, or get it working again after it blew up for who knows what reason.) It's a pain that you need pay for a copy of Markspace's Missing Sync when in principle you can get it to work for free, but in practice, if you time has value to you, it can be worth it. That is, of course, if you're stuck in 2003 and still prefer a Palm. If you join the iPhone horde, things tend to Just Work. (Aside from the small mountain of infuriating bugs unimplemented capabilities, but nevermind that, drink your kool-aid, there you go.) For Blackberry phones, PocketMac is dead simple to set up, and free. It wasn't written by RIM, but apparently works better than anything they were able to come up with on their own, because they allow you to download it from their web site. For a huge number of other phones with Bluetooth support, iSync can often Just Work, no problem. My mom had a bottom-end freebie Nokia phone that took all of 45 seconds to get syncing with iSync, and most of the other ones are about that easy. Apple has a list of supported phones on their site, but for a lot of others it's a matter of tweaking a .plist file to get it to work as well as the officially supported ones. http://www.apple.com/macosx/features/isync/ -- Chris Devers DO NOT LEAVE IT IS NOT REAL
Re: Is -C useless?
On Thu, 11 Sep 2008 15:19:17 +0200 Paul Johnson [EMAIL PROTECTED] wrote: since the standard streams are already set up at this point in the execution of the perl interpreter. You can use binmode() instead to get the desired behaviour. Waaait a moment. Why can't -C just call binmode itself? This is getting stupider by the moment. I've even tried this; it JustWorks: #!/usr/bin/perl BEGIN { exec $^X, -COL, -f, $0, @ARGV unless ${^UNICODE} } print Hello w\xe9rld\n; $ ./test-unicode.pl Hello wérld -- Paul LeoNerd Evans [EMAIL PROTECTED] ICQ# 4135350 | Registered Linux# 179460 http://www.leonerd.org.uk/ signature.asc Description: PGP signature
Re: Is -C useless?
Paul LeoNerd Evans [EMAIL PROTECTED] writes: On Thu, 11 Sep 2008 15:19:17 +0200 Paul Johnson [EMAIL PROTECTED] wrote: Which is just what you seem to have discovered ;-) In that case, I might have to consider the following: package utf8::LocaleAware; my $converted = 0; sub import { return if $converted; $converted = 1; return unless $ENV{LANG} =~ m/\.UTF-8/; You want LC_CTYPE, which can be inherited from LANG or overridden by LC_ALL. Also, not all the world is UTF-8. you want something like this: require I18N::Langinfo; require Encode; my encoding = I18N::Langinfo::langinfo(I18N::Langinfo::CODESET()); binmode STDIN, :encoding($encoding); binmode STDOUT, :encoding($encoding); binmode STDERR, :encoding($encoding); map { $_ = Encode::decode($encoding, $_) } @ARGV, values %ENV; binmode STDIN, :utf8; binmode STDOUT, :utf8; require Encode; map { $_ = Encode::decode_utf8 $_ } @ARGV, values %ENV; } -- ilmari A disappointingly low fraction of the human race is, at any given time, on fire. - Stig Sandbeck Mathisen
Re: Is -C useless?
On Fri, 12 Sep 2008 00:34:15 +0100 [EMAIL PROTECTED] (Dagfinn Ilmari Mannsåker) wrote: You want LC_CTYPE, which can be inherited from LANG or overridden by LC_ALL. Also, not all the world is UTF-8. I could want all sorts of things. I'm simply pointing out there's no reason why perl can't implement -C by the time it reads line 1 of the program script. That is not too late as its message would otherwise indicate. My demonstration using binmode already shows that. Why can't perl just call binmode itself on STDIN/STDOUT/STDERR by the time it gets that far, instead of throwing a wobbly and telling me to do it myself. That doesn't sound very DWIM to me And furthermore, binmode / decode_utf8 only get us round the IOE / A flags respectively. There is, to my knowledge, no perl code that can set the default UTF-8ness of new filehandles, the way that -Cio does. And all of this presumes that whoever calls binmode knows how to test the environment properly. It's come to my attention that this might be more accurate: binmode STDOUT, :utf8 if grep m/utf-?8/i, @ENV{qw(LANG LC_MESSAGES LC_ALL)}; And even then I'm not sure it's right. Which really just proves my point... The -C...L flag _already_ implements the correct logic. It's just not useful as it is... -- Paul LeoNerd Evans [EMAIL PROTECTED] ICQ# 4135350 | Registered Linux# 179460 http://www.leonerd.org.uk/ signature.asc Description: PGP signature
Re: Is -C useless?
On Fri, 12 Sep 2008 00:48:06 +0100 Paul LeoNerd Evans [EMAIL PROTECTED] wrote: binmode STDOUT, :utf8 if grep m/utf-?8/i, @ENV{qw(LANG LC_MESSAGES LC_ALL)}; And even then I'm not sure it's right. Actually it's still not... We have to take the first defined one, not try our best to find one: binmode STDOUT, :utf8 if ( $ENV{LC_ALL} || $ENV{LC_MESSAGES} || $ENV{LANG} ) =~ m/utf-?8/i which -technically- still breaks because we could have LC_ALL=0 in our environment, but I think it's close enough. Which really just proves my point... ... even more. -- Paul LeoNerd Evans [EMAIL PROTECTED] ICQ# 4135350 | Registered Linux# 179460 http://www.leonerd.org.uk/ signature.asc Description: PGP signature
Re: Is -C useless?
Paul LeoNerd Evans [EMAIL PROTECTED] writes: On Fri, 12 Sep 2008 00:48:06 +0100 Paul LeoNerd Evans [EMAIL PROTECTED] wrote: binmode STDOUT, :utf8 if grep m/utf-?8/i, @ENV{qw(LANG LC_MESSAGES LC_ALL)}; And even then I'm not sure it's right. Actually it's still not... We have to take the first defined one, not try our best to find one: binmode STDOUT, :utf8 if ( $ENV{LC_ALL} || $ENV{LC_MESSAGES} || $ENV{LANG} ) =~ m/utf-?8/i which -technically- still breaks because we could have LC_ALL=0 in our environment, but I think it's close enough. Or you could just use I18N::Langinfo. -- ilmari A disappointingly low fraction of the human race is, at any given time, on fire. - Stig Sandbeck Mathisen
Re: Is -C useless?
On Fri, Sep 12, 2008 at 12:28:22AM +0100, Paul LeoNerd Evans wrote: On Thu, 11 Sep 2008 15:19:17 +0200 Paul Johnson [EMAIL PROTECTED] wrote: since the standard streams are already set up at this point in the execution of the perl interpreter. You can use binmode() instead to get the desired behaviour. Waaait a moment. Why can't -C just call binmode itself? This is getting stupider by the moment. Well. As I recall (in other words, don't blame me if I'm wrong), the problem wasn't that it couldn't be made to work, but rather than no one could be found who had the time, ability and inclination to make it work. But stopping it being broken was easier. Perhaps you are that person? You certainly seem to be at least one third of the way there. -- Paul Johnson - [EMAIL PROTECTED] http://www.pjcj.net
Re: [PATCH] XML::Compile::SOAP on Perl 5.6.1
On Thu, Sep 11, 2008 at 11:39:58AM +0200, Mark Overmeer wrote: [is this really something to get London.pm involved in? Let's continue solely on the XML::Compile mailing list after this] * Toby Corkindale ([EMAIL PROTECTED]) [080911 01:38]: The attached patches to Log::Report and XML::Compile::SOAP are enough to get it functional on Perl 5.6, despite the normal requirements for Perl 5.8. I think both patches will make it main stream, with a little rewrite. What about: if ($] = 5.008002) { require Encode; Encode-import; } else { *encode = sub { $_[1] }; } What do you think? Or should it use utf8::downgrade for some subset of older versions? I agree, the *encode method is much neater. I confirm it works on 5.6.1. I'm not familiar with utf8::downgrade - are you suggesting it is available on Perl 5.6.x? (It doesn't look like it to me) thanks, Toby -- Turning and turning in the widening gyre/The falcon cannot hear the falconer; Things fall apart, the centre cannot hold/Mere anarchy is loosed upon the world (gpg --recv-key B1CCF88E)