Commit Graph

9 Commits (20fe87c0f41ef0f8420a841bafad84f825a6f248)

Author SHA1 Message Date
Giel van Schijndel 0832e1f5eb * Fix warning about suggested parentheses
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2297 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-31 14:20:28 +00:00
Giel van Schijndel e9d8948939 * Just use uint32_t to store UTF-32 (or UCS-4) characters in rather than uint_fast32_t which probably falls into the category premature optimization
* Fix macro ASSERT_START_OCTET (I used a logical and there instead of logical or)

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2296 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-31 14:17:35 +00:00
Giel van Schijndel 17ac519765 * Assert that the starting octect of a UTF-8 codepoint sequence is correct
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2293 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-31 12:07:12 +00:00
Giel van Schijndel ed18068ec8 * Forgot to return the determined length value of unicode_strlen: doh!
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2286 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-30 16:28:38 +00:00
Giel van Schijndel 7c73b0a9e1 * Add function "size_t unicode_strlen(const utf_32_char* unicode_string)" which determines the amount of characters in a UTF-32 encoded string
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2285 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-30 16:27:39 +00:00
Giel van Schijndel f78bb18a5b * Use a typedef utf_32_char in the UTF-8 code to store UTF-32 characters in
* This way it should be easy to change the type of utf_32_char if ever needed (currently it is uint_fast32_t)

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2284 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-30 15:34:44 +00:00
Giel van Schijndel 100309f547 * Provide implementation of function "uint_fast32_t* utf8_decode(const char* utf8_string)" which decodes a UTF-8 encoded string into a UTF-32 (native endianess) encoded Unicode string (UTF-32 is the "native" unicode encoding)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2283 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-30 15:15:02 +00:00
Giel van Schijndel 8bbe10a748 * Provide implementation of function "size_t utf8_character_count(const char* utf8_string)" which counts the amount of characters (not bytes/octects!) in a UTF-8 encoded string
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2282 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-30 14:46:15 +00:00
Giel van Schijndel 38a82a2ada * Add UTF-8 encoder (the decoder is a WIP)
* Add files lib/framework/utf8.[ch] to autoconf/automake, raw makefiles, Code::Blocks and MSVC
NOTE: this may require updating of some additionaly buildsystems (e.g. OSX)

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2281 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-30 14:02:05 +00:00