Permalink
Browse files

Don't specify charset for inline javascript, only

for scripts loaded remotely.
  • Loading branch information...
Dan Wood
Dan Wood committed Mar 31, 2011
1 parent 30bc106 commit 3530727395fd7fbdafe58c4c4129a211f2c2c5de
Showing with 5 additions and 2 deletions.
  1. +5 −2 KSHTMLWriter.m
View
@@ -274,8 +274,11 @@ - (void)startJavascriptElementWithSrc:(NSString *)src; // src may be nil
}
// Script
- if (src) [self pushAttribute:@"src" value:src];
- [self pushAttribute:@"charset" value:@"UTF-8"];
+ if (src)
+ {
+ [self pushAttribute:@"src" value:src];
+ [self pushAttribute:@"charset" value:@"UTF-8"]; // ensure that remotely load source is UTF-8
+ }
[self startElement:@"script"];

1 comment on commit 3530727

@mikeabdullah

This comment has been minimized.

Show comment Hide comment
@mikeabdullah

mikeabdullah Mar 31, 2011

Collaborator

I'm a little wary of assuming scripts are UTF8

Collaborator

mikeabdullah commented on 3530727 Mar 31, 2011

I'm a little wary of assuming scripts are UTF8

Please sign in to comment.