Dev.SN
Dev.SN ♥ developers
https://dev.soylentnews.org/

Title    Sig and Bio length tests
Date    Friday May 22 2015, @11:06AM
Author    martyb
Topic   
from the more-fun-with-UTF-8 dept.
https://dev.soylentnews.org/article.pl?sid=15/05/22/156217

martyb writes:

Sig and Bio user preferences test. The user preferences page (https://dev.soylentnews.org/users.pl) describes these fields as:

Sig: Appended to the end of comments you post. 120 chars.

Bio: This information is publicly displayed on your user page. 255 chars.

These tests ensure that we support that number of characters and not just that number of bytes. Specifically, characters greater than U+007f require 2 or more octets (bytes) to represent them as UTF-8 chars, as follows (taken from https://tools.ietf.org/html/rfc3629):

Char. number range  |        UTF-8 octet sequence
   (hexadecimal)    |              (binary)
--------------------+---------------------------------------------
0000 0000-0000 007F | 0xxxxxxx
0000 0080-0000 07FF | 110xxxxx 10xxxxxx
0000 0800-0000 FFFF | 1110xxxx 10xxxxxx 10xxxxxx
0001 0000-0010 FFFF | 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx

Links

  1. "martyb" - https://dev.soylentnews.org/~martyb/

© Copyright 2024 - Soylent News, All Rights Reserved

printed from Dev.SN, Sig and Bio length tests on 2024-05-16 22:41:29