Firmware: A-410 [01 Apr. 2014] | A-400 [12 Mar. 2014] | C-300 [13 Feb. 2014] | A-300 [24 Feb. 2014] | C-200 [11 July 2013] | A-200/A-210 [11 July 2013] | Popbox V8 [3 Dec 2013]

Just got your NMT | WIKI has the answers | Search the forum | Forum Rules/Policy | Firmware & Official NMT News | Popcornhour manuals



User(s) browsing this thread: 2 Guest(s)
Thread Closed 
bytes vs characters
02-18-2009, 09:08 PM (This post was last modified: 02-18-2009 09:09 PM by excal.)
Post: #1
bytes vs characters
(Boy i'm a little nervous of coming out of this looking like a fool, but what ever...)

So i hit my limit in javscript, and i went back to look into what the limit was and i had a question about the answer...

From what i know....

Quote:The limit of inline script is 23360 bytes in total size per script (between a <script> ...</script>. You can have multiple scripts of this size in one html)

External files have no such limit, but have another limit of no more than 2048 characters per line of code (separate by newline).

So how do i know how many bytes a particular script is within a file?

I always knew bytes as a file size....so i expected the limit to be in characters...not bytes. Characters i know i can just have my editor count... (maybe my editor can count bytes too...not sure). So how do i go about counting bytes?
Find all posts by this user
02-18-2009, 09:13 PM
Post: #2
RE: bytes vs characters
1 character = 1 byte?

Or so I thought

- Sennap

NMT: PCH A-100
TV: Sony Bravia 40" LCD Full HD
Audio: Logitech Z-5500 Digital
HDD: 2x1 TB 3,5" WD Green (external) ext3, 320 GB 3,5" (external) NTFS, 250 GB 2,5" (internal) ext3
Find all posts by this user
02-18-2009, 09:18 PM (This post was last modified: 02-18-2009 09:18 PM by halfelite.)
Post: #3
RE: bytes vs characters
I always thought it was 4 bytes = character at least for utf-8
Find all posts by this user
02-18-2009, 09:23 PM
Post: #4
RE: bytes vs characters
hmmm i suppose i can count the characters in my script and know roughly how it equates... I know i'm really close to the limit, i had to remove a few lines to make it work. So i would assume i'm slightly under but close enough to maybe do some sorta conversion...
Find all posts by this user
02-18-2009, 09:25 PM (This post was last modified: 02-18-2009 09:27 PM by spawn.)
Post: #5
RE: bytes vs characters
http://dt.in.th/2008-09-16.string-length-in-bytes.html

http://www.java2s.com/Tutorial/Java/0040...fBytes.htm

Living room: C200/A200/A100 HDMI to Pioneer KURO KRP-500A plasma / Denon AVR 3808 / KEF 5005.2 / B&W DM685
Kids room: C200/A110 HDMI to Panasonic 42PZ85, Optical to Logitech Z5500.


PLEASE READ THE WIKI
Find all posts by this user
02-18-2009, 09:34 PM
Post: #6
RE: bytes vs characters
ahhh...alright so i guess i can jerry rig the script to report it to me on my PC.

According to that 1st link though, in english its 1:1 where as its different in others.

I'll report back with my findings when i get a chance to test it out.
Find all posts by this user
02-18-2009, 11:04 PM
Post: #7
RE: bytes vs characters
Just have a seperate file, copy all your javascript to there and call it via

script type="text/javascript" src="whatever.js"

That gets round any inline limits. Smile

On unix a good way to check bytes is to use the wc command:

wc -c blah.js

My NMT apps / themes
Find all posts by this user
02-18-2009, 11:15 PM
Post: #8
RE: bytes vs characters
ya thats my plan, its not a problem to get around the limit.

i was just asking out of my own curiosity to get a feel for what the limit was.
Find all posts by this user
Thread Closed 


Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Warning - tmpfile ??? is 0 bytes, this won't end well. niklaso 39 7,178 04-30-2008 05:43 AM
Last Post: bchenoweth

Forum Jump: