1

I am using parser in m Windows Phone Application.

CSSDocument css = new CSSDocument();
CSSParser parser = new CSSParser();
BoneSoft.CSS.CSSParser parser = new BoneSoft.CSS.CSSParser();
parser.ParseText("body {font-family: Helvetica, arial, sans-serif;font-size: 16px;}h2 {color: #e2703b;}.newsimage{margin-bottom:10px;}.date{text-align:right;font-size:35px;}");
css = parser.CSSDocument;

there is an error in this buid in library method:

public CSSDocument ParseText(string content) {
    MemoryStream mem = new MemoryStream();
    byte[] bytes = ASCIIEncoding.ASCII.GetBytes(content);
    mem.Write(bytes, 0, bytes.Length);
    return ParseStream(mem);
}

Attempt to access the method failed: System.Text.Encoding.get_ASCII()

What I am doing wrong?

Update1 I have found information that Windows Phone is not suported ASCII encoding. So is there any other way how I can parse css for Windows phone?

Update2 As a variant I have just change the code of parser and compile a new dll. So now

I put into this method byte array

public CSSDocument ParseText(byte[] bytes ) {
            MemoryStream mem = new MemoryStream();
                        mem.Write(bytes, 0, bytes.Length);
            return ParseStream(mem);
        }

and it resolve this issue, but is there other way how can I parse css for Windows Phone?

revolutionkpi
  • 2,632
  • 10
  • 45
  • 84

0 Answers0