Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Add ustring Tag Support #8

Open
wants to merge 1 commit into from

2 participants

@kunklejr

Added support for unicode string (ustring) tag.

@bleything
Owner

I've never seen a ustring tag before. Can you show me an example? I added some unicode characters to a regular string tag using Xcode's plist editor and it was saved as a regular string tag.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Oct 27, 2011
  1. @kunklejr

    Add support for ustring tag

    kunklejr authored
This page is out of date. Refresh to see the latest.
Showing with 11 additions and 0 deletions.
  1. +6 −0 lib/plist/parser.rb
  2. +5 −0 test/test_parser.rb
View
6 lib/plist/parser.rb
@@ -168,6 +168,12 @@ def to_ruby
end
end
+ class PUstring < PTag
+ def to_ruby
+ CGI::unescapeHTML(text || '')
+ end
+ end
+
class PArray < PTag
def to_ruby
children.collect do |c|
View
5 test/test_parser.rb
@@ -77,6 +77,11 @@ def test_decode_entities
assert_equal('Fish & Chips', data)
end
+ def test_decode_ustring
+ data = Plist::parse_xml("<ustring>Fish 'N Chips \u2122</ustring>")
+ assert_equal("Fish 'N Chips \u2122", data)
+ end
+
def test_comment_handling_and_empty_plist
assert_nothing_raised do
assert_nil( Plist::parse_xml( File.read('test/assets/commented.plist') ) )
Something went wrong with that request. Please try again.