https://github.com/nextfaze/characterentityconverter
Objective C library for character entity conversions
https://github.com/nextfaze/characterentityconverter
Last synced: 8 months ago
JSON representation
Objective C library for character entity conversions
- Host: GitHub
- URL: https://github.com/nextfaze/characterentityconverter
- Owner: NextFaze
- License: apache-2.0
- Created: 2011-03-18T06:10:11.000Z (over 15 years ago)
- Default Branch: master
- Last Pushed: 2015-10-30T05:35:29.000Z (over 10 years ago)
- Last Synced: 2025-03-27T03:31:30.681Z (over 1 year ago)
- Language: Objective-C
- Homepage: https://github.com/2moro/CharacterEntityConverter
- Size: 148 KB
- Stars: 2
- Watchers: 19
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# CharacterEntityConverter
CharacterEntityConverter - Objective C library for character entity conversions
## Installation
> git clone git://github.com/NextfazeSD/CharacterEntityConverter.git
## Interfaces
CharacterEntityConverter:
+ (NSString *)decodeEntities:(NSString *)string;
+ (NSString *)decodeEntitiesForXML:(NSString *)string;
+ (NSString *)encodeEntities:(NSString *)string;
+ (NSString *)encodeEntitiesForXML:(NSString *)string;
+ (NSString *)encodeEntities:(NSString *)string fromCodePoint:(unsigned int)fromCodePoint html:(BOOL)html;
NSString+CharacterEntityConverter: (NSString category)
- (NSString *)stringByEncodingEntities;
- (NSString *)stringByEncodingEntitiesForXML;
- (NSString *)stringByDecodingEntities;
- (NSString *)stringByDecodingEntitiesForXML;
NSMutableString+CharacterEntityConverter: (NSMutableString category)
- (void)encodeEntities;
- (void)encodeEntitiesForXML;
- (void)decodeEntities;
- (void)decodeEntitiesForXML;
## Synopsis
decoding character entities
#import "NSString+CharacterEntityConverter.h"
[@"foo & bar" stringByDecodingEntities]; // -> "foo & bar"
[@"foo & ™" stringByDecodingEntitiesForXML]; // -> "foo & bar ™" (™ is not valid in XML)
encoding character entities
#import "NSString+CharacterEntityConverter.h"
[@"foo & bar" stringByEncodingEntities]; // -> "foo & bar"
[@"foo & bar ™" stringByEncodingEntitiesForXML]; // -> "foo & bar ™" (™ is not valid in XML)
## License
CharacterEntityConverter is licensed under the terms of the [Apache License, version 2.0](http://www.apache.org/licenses/LICENSE-2.0.html). Please see the [LICENSE](https://github.com/NextfazeSD/CharacterEntityConverter/blob/master/LICENSE) file for full details.
## Credits
CharacterEntityConverter is brought to you by [Andrew Williams](http://github.com/sobakasu) and supported by the [NextFaze](http://www.nextfaze.com) team and the GitHub community.