utf8proc
diff ruby/utf8proc_native.c @ 7:fcfd8c836c64
Version 1.1.1
- Added a new PostgreSQL function 'unistrip', which behaves like 'unifold', but also removes all character marks (e.g. accents).
- Changed license from BSD to MIT style.
- Added a new function 'utf8proc_codepoint_valid' to the C library.
- Changed compiler flags in Makefile from -g -O0 to -O2
- The ruby script, which was used to build the utf8proc_data.c file, is now included in the distribution.
- Added a new PostgreSQL function 'unistrip', which behaves like 'unifold', but also removes all character marks (e.g. accents).
- Changed license from BSD to MIT style.
- Added a new function 'utf8proc_codepoint_valid' to the C library.
- Changed compiler flags in Makefile from -g -O0 to -O2
- The ruby script, which was used to build the utf8proc_data.c file, is now included in the distribution.
author | jbe |
---|---|
date | Sun Jul 22 12:00:00 2007 +0200 (2007-07-22) |
parents | c18366878af9 |
children | 00d2bcbdc945 |
line diff
1.1 --- a/ruby/utf8proc_native.c Fri Mar 16 12:00:00 2007 +0100 1.2 +++ b/ruby/utf8proc_native.c Sun Jul 22 12:00:00 2007 +0200 1.3 @@ -1,40 +1,30 @@ 1.4 /* 1.5 - * Copyright (c) 2006, FlexiGuided GmbH, Berlin, Germany 1.6 - * Author: Jan Behrens <jan.behrens@flexiguided.de> 1.7 - * All rights reserved. 1.8 + * Copyright (c) 2006-2007 Jan Behrens, FlexiGuided GmbH, Berlin 1.9 * 1.10 - * Redistribution and use in source and binary forms, with or without 1.11 - * modification, are permitted provided that the following conditions are 1.12 - * met: 1.13 + * Permission is hereby granted, free of charge, to any person obtaining a 1.14 + * copy of this software and associated documentation files (the "Software"), 1.15 + * to deal in the Software without restriction, including without limitation 1.16 + * the rights to use, copy, modify, merge, publish, distribute, sublicense, 1.17 + * and/or sell copies of the Software, and to permit persons to whom the 1.18 + * Software is furnished to do so, subject to the following conditions: 1.19 * 1.20 - * 1. Redistributions of source code must retain the above copyright 1.21 - * notice, this list of conditions and the following disclaimer. 1.22 - * 2. Redistributions in binary form must reproduce the above copyright 1.23 - * notice, this list of conditions and the following disclaimer in the 1.24 - * documentation and/or other materials provided with the distribution. 1.25 - * 3. Neither the name of the FlexiGuided GmbH nor the names of its 1.26 - * contributors may be used to endorse or promote products derived from 1.27 - * this software without specific prior written permission. 1.28 + * The above copyright notice and this permission notice shall be included in 1.29 + * all copies or substantial portions of the Software. 1.30 * 1.31 - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 1.32 - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 1.33 - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 1.34 - * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER 1.35 - * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 1.36 - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 1.37 - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 1.38 - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 1.39 - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 1.40 - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 1.41 - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 1.42 - * 1.43 + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 1.44 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 1.45 + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 1.46 + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 1.47 + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 1.48 + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 1.49 + * DEALINGS IN THE SOFTWARE. 1.50 */ 1.51 - 1.52 + 1.53 1.54 /* 1.55 * File name: ruby/utf8proc_native.c 1.56 - * Version: 1.0 1.57 - * Last changed: 2006-09-17 1.58 + * Version: 1.1.1 1.59 + * Last changed: 2007-07-22 1.60 * 1.61 * Description: 1.62 * Native part of the ruby wrapper for libutf8proc. 1.63 @@ -122,9 +112,7 @@ 1.64 ssize_t result; 1.65 int uc; 1.66 uc = NUM2INT(code_param); 1.67 - if (uc < 0 || uc >= 0x110000 || 1.68 - ((uc & 0xFFFF) >= 0xFFFE) || (uc >= 0xD800 && uc < 0xE000) || 1.69 - (uc >= 0xFDD0 && uc < 0xFDF0)) 1.70 + if (!utf8proc_codepoint_valid(uc)) 1.71 rb_raise(rb_eArgError, "Invalid Unicode code point"); 1.72 result = utf8proc_encode_char(uc, buffer); 1.73 return rb_str_new(buffer, result); 1.74 @@ -165,4 +153,3 @@ 1.75 rb_define_const(utf8proc_ruby_module, "Options", utf8proc_ruby_options); 1.76 } 1.77 1.78 -