metalaureate / prosody-modules

Automatically exported from code.google.com/p/prosody-modules
0 stars 0 forks source link

mod_pastebin counts bytes instead of utf-8 characters #13

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Since mod_pastebin counts bytes instead of utf-8 characters,
on other languages, for example Russian, the character threshold limit would 
practically be twice smaller.

Changing the length count with the following patch fixes this problem.

Original issue reported on code.google.com by i@grompe.org.ru on 11 Jul 2011 at 2:02

Attachments:

GoogleCodeExporter commented 9 years ago
Applied, slightly modified. The common case is for message bytes and codepoints 
to be below the threshold, so it only counts UTF8 sequences if the bytes > 
threshold.

Thanks!

Original comment by MWild1 on 8 Dec 2011 at 10:04