Re: xml utf-8 encoding error

2017-08-29 Thread graw-prog via Digitalmars-d-learn

On Tuesday, 29 August 2017 at 15:55:50 UTC, Adam D. Ruppe wrote:

On Tuesday, 29 August 2017 at 04:41:34 UTC, graw-prog wrote:
I'm not sure what the problem is. It seems to be may the 
lowercase 'utf-8' in the charset section but I'm not sure if 
the problem is some mistake I made, a bug in DMD or just lousy 
xml. Either way is there any way around this issue?



It looks like a bug in Phobos:

http://dpldocs.info/experimental-docs/source/std.net.curl.d.html#L2470


That's where it populates the charset that it passes to Phobos' 
(woefully inadequate btw) encoding decoder... and it doesn't 
handle the quotes correctly according to the http standard.



I guess you could probably hack it by editing your copy of 
Phobos or change your server to remove the quotes.


Thank you for the explanation. I guess I'll have to take a look 
in phobos and see if I can figure out how to make it work. I'm 
getting the data using the api built into the tv so I don't think 
I can change anything on the server side. Thank you everybody for 
your help.


Re: xml utf-8 encoding error

2017-08-29 Thread Kagamin via Digitalmars-d-learn

On Tuesday, 29 August 2017 at 15:55:50 UTC, Adam D. Ruppe wrote:

http://dpldocs.info/experimental-docs/source/std.net.curl.d.html#L2470


Ow, annotated sources, cool.

pre {
box-sizing: border-box;
overflow: auto;
max-width: 800px; /* The script sets the real one */
max-width: calc(80vw - 16em - 4em);
}
Hmm... AFAIK free side space on pages is left so that the content 
is not too wide in characters, not because people like free side 
space :) But for preformatted text such limit makes little sense, 
it's only for word-wrapped text. I'd say code should take all the 
width it wants.


Re: xml utf-8 encoding error

2017-08-29 Thread Adam D. Ruppe via Digitalmars-d-learn

On Tuesday, 29 August 2017 at 04:41:34 UTC, graw-prog wrote:
I'm not sure what the problem is. It seems to be may the 
lowercase 'utf-8' in the charset section but I'm not sure if 
the problem is some mistake I made, a bug in DMD or just lousy 
xml. Either way is there any way around this issue?



It looks like a bug in Phobos:

http://dpldocs.info/experimental-docs/source/std.net.curl.d.html#L2470


That's where it populates the charset that it passes to Phobos' 
(woefully inadequate btw) encoding decoder... and it doesn't 
handle the quotes correctly according to the http standard.



I guess you could probably hack it by editing your copy of Phobos 
or change your server to remove the quotes.


Re: xml utf-8 encoding error

2017-08-29 Thread ag0aep6g via Digitalmars-d-learn

On 08/29/2017 05:41 PM, Kagamin wrote:

On Tuesday, 29 August 2017 at 04:41:34 UTC, graw-prog wrote:

< Content-Type: text/xml; charset="utf-8"


Should be
Content-Type: text/xml; charset=utf-8


HTTP allows a quoted string there.

https://tools.ietf.org/html/rfc7231#section-3.1.1.1


Re: xml utf-8 encoding error

2017-08-29 Thread Adam D. Ruppe via Digitalmars-d-learn

On Tuesday, 29 August 2017 at 15:41:58 UTC, Kagamin wrote:

Should be
Content-Type: text/xml; charset=utf-8


I'm pretty sure both are equally legal.


Re: xml utf-8 encoding error

2017-08-29 Thread Kagamin via Digitalmars-d-learn

On Tuesday, 29 August 2017 at 04:41:34 UTC, graw-prog wrote:

< Content-Type: text/xml; charset="utf-8"


Should be
Content-Type: text/xml; charset=utf-8