Re: Converting string to encoding

2008-06-14 Thread dexter morgan
What do you think about it? (I've found this in Pantomime framework)
http://pastebin.com/m2a8e4df2

So my code become simple:

NSData *data = [self decodeQuotedPrintableInHeader: NO]; // self is raw data
from file (written in NSISOLatin1)

encoded = [[NSString alloc] initWithData: data encoding:finalEncoding]; //
final encoding is UTF-8 according to headers


However the results of encoded is nil :(


On Sat, Jun 14, 2008 at 5:36 PM, Jens Alfke <[EMAIL PROTECTED]> wrote:

> I think the problem is here:
>
> [newString appendFormat:@"%c", (char)character];
>>
>
> This interprets the character as Unicode, since NSString is pure Unicode.
> Then when you ask for the data in ISO-Latin-1, that character gets encoded
> from Unicode to ISO-Latin-1, which changes its numeric value (if it's > 7F).
> But then you read it back into a string as ISO-Latin-1, which will keep the
> changed value, so it's not the character you intended.
>
> I don't think it's best to do this by translating back and forth between
> data and string. It's slow, and there's too much opportunity for encoding
> mistakes like this one. Instead, just leave it as NSData and scan through
> the raw bytes; then convert the unquoted result data directly into the
> desired string encoding.
>
> —Jens
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Swapping splitview subviews

2008-06-18 Thread dexter morgan
Hello,
I'm using NSSplitView with two subviews in both vertical and horizontal
mode.
In awakeFromNib of my code I use -addSubView to fill the first subview (the
other is just filled because I've created it in IB).
Is there a way to swap these subviews? (invert the position).
Any hint?
Thanks.
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


How to use .a in XCode?

2008-06-25 Thread dexter morgan
Hello guys,
I need to use id3lib inside my xcode project.
Basically it's a Cocoa app with some c/c++ source files.
At this time I would simply get it compiled.

I've downloaded id3lib and now it's under /usr/local/include/id3 (some
headers), /usr/local/lib (libraries .a) and finally
/usr/local/include/bin (I think I'll not need of this last folder).

In my source code I've following imports:

#include 
#include 
#include 

is id3 the folder inside /usr/local/include?
How can I import these libreries into the project? (I would to copy
these files into app package in order to allow app launch even if you
have not installed id3lib in /usr/local.

TIA
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


NSURLConnection and JavaScript

2008-08-28 Thread dexter morgan
Hello guys,
I'm using NSURLConnection to download a web page. Unfortunatly some
particular pages detects JavaScript compatibility so the result data
is something like "you cannot see this page because you have not js
enabled".
Is there any way to workaround this "problem"?
Thank you so much
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


NSURLConnection nil result (only on 10.4)

2008-08-31 Thread dexter morgan
Hello List,
I'm using NSURLConnection/NSURLRequest in order to download some pages
from the web.
My app should be compatible both with 10.4 and 10.5.
However I've noticed a strange behavior only on 10.4: the method -
(void)connection:(NSURLConnection *)connection didReceiveData:(NSData
*)data {
never called and my _receivedData object still empty.
The result on - (void)connectionDidFinishLoading:(NSURLConnection
*)connection  method is a nil content.

The code is:

_request = [[NSMutableURLRequest alloc] initWithURL: _url];
[_request setHTTPMethod: @"POST"];
[_request setHTTPShouldHandleCookies: YES];

// setup user agent (standard mode or custom)
[_request setValue: ([_options objectForKey: @"CURLOPT_USERAGENT"] == 
nil ?
 STEALTH_USERAGENT :
 [_options objectForKey: 
@"CURLOPT_USERAGENT"])
forHTTPHeaderField:@"User-Agent"];  

// init session data container
[_receivedData release];
_receivedData= [[NSMutableData alloc] init];

// create a new connection
[_connection release];  
_connection = [[[NSURLConnection alloc] initWithRequest: _request
delegate: self] retain];

All works fine on 10.5.
I've also noticed that this error happends only for certain address.
For example this works fine:
http://www.tim.it/consumer/homepage.do

while these not:
https://www.190.it/190/trilogy/jsp/login.do
http://www.tele2internet.it/clogin.phtml
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: NSURLConnection nil result (only on 10.4)

2008-08-31 Thread dexter morgan
I've solved the problem... on 10.4 does not follow redirects so you
need to implement something like this.

-(NSURLRequest *)connection:(NSURLConnection *)connection
willSendRequest:(NSURLRequest *)request
redirectResponse:(NSURLResponse *)redirectResponse {
NSMutableURLRequest *newRequest = [request mutableCopy];
// returned request has had the UA field stripped, must fix
[newRequest setTimeoutInterval:15.0];
[newRequest setCachePolicy:NSURLRequestReloadIgnoringCacheData];
return newRequest;
}


On Sun, Aug 31, 2008 at 12:27 PM, dexter morgan <[EMAIL PROTECTED]> wrote:
> Hello List,
> I'm using NSURLConnection/NSURLRequest in order to download some pages
> from the web.
> My app should be compatible both with 10.4 and 10.5.
> However I've noticed a strange behavior only on 10.4: the method -
> (void)connection:(NSURLConnection *)connection didReceiveData:(NSData
> *)data {
> never called and my _receivedData object still empty.
> The result on - (void)connectionDidFinishLoading:(NSURLConnection
> *)connection  method is a nil content.
>
> The code is:
>
>_request = [[NSMutableURLRequest alloc] initWithURL: _url];
>[_request setHTTPMethod: @"POST"];
>[_request setHTTPShouldHandleCookies: YES];
>
>// setup user agent (standard mode or custom)
>[_request setValue: ([_options objectForKey: @"CURLOPT_USERAGENT"] == 
> nil ?
> STEALTH_USERAGENT :
> [_options objectForKey: 
> @"CURLOPT_USERAGENT"])
>forHTTPHeaderField:@"User-Agent"];
>
>// init session data container
>[_receivedData release];
>_receivedData= [[NSMutableData alloc] init];
>
>// create a new connection
>[_connection release];
>_connection = [[[NSURLConnection alloc] initWithRequest: _request
> delegate: self] retain];
>
> All works fine on 10.5.
> I've also noticed that this error happends only for certain address.
> For example this works fine:
> http://www.tim.it/consumer/homepage.do
>
> while these not:
> https://www.190.it/190/trilogy/jsp/login.do
> http://www.tele2internet.it/clogin.phtml
>
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Getting location for an NSStatusItem

2008-09-05 Thread dexter morgan
Hello list,
I would to show an NSWindow at the bottom of my NSStatusItem. How can
I get the location of it?
Thanks
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: Getting location for an NSStatusItem

2008-09-05 Thread dexter morgan
I've found something here:
http://mattgemmell.com/2008/03/04/using-maattachedwindow-with-an-nsstatusitem

On Fri, Sep 5, 2008 at 1:59 PM, dexter morgan <[EMAIL PROTECTED]> wrote:
> Hello list,
> I would to show an NSWindow at the bottom of my NSStatusItem. How can
> I get the location of it?
> Thanks
>
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Link aganist

2008-09-11 Thread dexter morgan
Hello List,
I've a simple c project that uses semaphores.
I've tried to include it inside the main.c

#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 

but xcode won't to compile it. Anyone can help me?
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Link aganist

2008-09-12 Thread dexter morgan
I've made as you suggested but nothing is changed.
Take a look here:
http://img440.imageshack.us/img440/103/picture1it4.png
thanks a lot

On Fri, Sep 12, 2008 at 12:27 AM, Meik Schuetz <[EMAIL PROTECTED]> wrote:
> Hi there,
> in the target properties, make sure the header file search path is set to
> the directory in which you've got the 3rd party header files. To link the
> dylib files with the project, click on Project -> Add to project and select
> the necessary dylib files.
>
> Hope that helps.
> Meik
>
>
> On Sep 11, 2008, at 11:04 PM, dexter morgan wrote:
>
>> Hello List,
>> I've a simple c project that uses semaphores.
>> I've tried to include it inside the main.c
>>
>> #include 
>> #include 
>> #include 
>> #include 
>> #include 
>> #include 
>> #include 
>> #include 
>> #include 
>> #include 
>>
>> but xcode won't to compile it. Anyone can help me?
>> ___
>>
>> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
>>
>> Please do not post admin requests or moderator comments to the list.
>> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>>
>> Help/Unsubscribe/Update your Subscription:
>> http://lists.apple.com/mailman/options/cocoa-dev/cocoa%40consjuri.net
>>
>> This email sent to [EMAIL PROTECTED]
>
>
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


NSURLConnection and HTTPS

2008-10-03 Thread dexter morgan
Hello I'm using NSURLConnection in order to download some pages. All
works fine until I try to load an HTTPS page.
This is an example:
https://www.wireless.att.com/olam/loginAction.olamexecute
It return a differ page (not the same viewed into Safari).
I think there is a problem accepting certificates of this page.
Searching inside the list I've found this code:
[_request setAllowsAnyHTTPSCertificate:YES forHost: [_url host]];

It's a private API. Unfortunatly the message is too old (2005) and at
this time this method seems to be removed.
Anyone can point me to a solution?
TIA
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]