Re: Remove characters from string
Re: Remove characters from string
- Subject: Re: Remove characters from string
- From: John Joyce <email@hidden>
- Date: Fri, 18 Mar 2011 23:28:04 +0800
You might also consider using HTML entities for those, as you never know what the browser/user-agent has set for encoding...
On Mar 18, 2011, at 11:24 PM, Gary L. Wade wrote:
> In that case, you should determine what encoding your web page is being displayed in and convert your NSString to that encoding. If it's in UTF8, you can use UTF8String; otherwise, consider dataUsingEncoding: or related messages to see if that will do what you need.
>
> - Gary L. Wade (Sent from my iPad)
>
> On Mar 18, 2011, at 8:03 AM, "Heizer, Charles" <email@hidden> wrote:
>
>> I'm looking to clean up some system profiler data before sending it to a
>> database to have it displayed on a web page. Wile I can insert the data in
>> to the MySQL database just fine. The copyright and registered symbols do
>> not display properly on a web page. I was just thinking to make life easy
>> I could just remove them before posting to my database so that I don¹t
>> have to deal with it on the web end.
>>
>> Charles
>>
>>
>>
>>
>>
>>
>> On 3/17/11 12:12 PM, "Gary L. Wade" <email@hidden> wrote:
>>
>>> Is it possible you're assuming text being given to you is in ASCII format
>>> but is actually in UTF-8 or some other encoding? Try looking at the text
>>> you have in other encodings before trying to remove characters.
>>>
>>> On 03/17/2011 6:03 AM, "Heizer, Charles" <email@hidden> wrote:
>>>
>>>> Hello,
>>>> I would like to know how to remove certain characters from a NSString.
>>>> The
>>>> characters are "©". I thought I could just use encodings and convert the
>>>> string using NSASCIIStringEncoding but that did not work and I'm not sure
>>>> what the car codes are for these as well.
>>>>
>>>> Thanks,
>>>> Charles
>>>
>>>
>>> _______________________________________________
>>>
>>> Cocoa-dev mailing list (email@hidden)
>>>
>>> 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:
>>>
>>> This email sent to email@hidden
>>
> _______________________________________________
>
> Cocoa-dev mailing list (email@hidden)
>
> 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:
>
> This email sent to email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden