Changing CodeIgniter url_title from Czech characters to standard English characters - codeigniter

What's the best way to save CodeIgniter url_title's originally written using Czech characters as standard English characters? For example:
Currently this:
/projects/Hledám-sponzora-na-nákup-příslušenství-k-invalidní1/123
I'd prefer this:
/projects/hledam-sponzora-na-nakup-prislusenstvi-k-invalidni1/123
I tried changing just the url_title table collation to non-Czech, but it caused an error when submitting the form. Any ideas?

Just in case anybody needs it (a year later), try with convert_accented_characters() of the Text Helper. This is how I do it:
url_title(convert_accented_characters($title_with_accents), 'dash', TRUE)
Works quite well :)
You can also check the file application/config/foreign_chars.php and edit it if it's needed.

I don't understand what you are trying to do... Are these urls? If so, I'd choose numbers that associate to the titles you want to use.
Could you show the markup of the form? Also the controller function that handles the submission could be major help... Help us help you!

Related

is it possible to use Arabic letter using laravel-dompdf?

Currently I'm facing one problem to create PDF that is support Arabic letters.
But all letters are revered when generate that. I'd like to use that.
Anyone can help me?
That's the issue in laravel-dompdf. Use tcpdf-laravel instead of that.

How can I change this symbol? Magento

I have this page:
http://www.moment-of-style.com/onlajn-magazin/pal-to-pidzhaki/denim-bomber-148.html
I simply replace this with something and can not find where to do this modification.
I put an image to better understand what they want
I tried to follow this tutorial but I could not.
http://magentocoders.blogspot.in/2011/10/insert-rupee-symbol-instead-of-rs-in.html
Can anyone help me to solve this problem?
I think the shown currency is Russian Ruble. The currency code for Rubles is RUB, and the currency symbol is руб. The question isn't clear. So i will give you suggestions as i understood your question.
First of all, if you want to use Russian Ruble as your currency then the symbol 'руб' is perfect. Although no symbol exists officially, руб (three Cyrillic characters which are the equivalent of RUB in Russian) is currently used.
Second, if you want to use RUB instead of руб then follow the below steps. It works perfect for me.
Goto->AdminPanel->Configuration->Currency Setup->Base Currency(Set Russian Rubel). Do the same for Default Display Currency and allowed currency.
Now Go to->Adminpanel->System->Manage Currency->Symbols-> Change your symbol here(You can see руб here, change it).
Third and the last, characters of your site suggest the Serbian language(as per Google translate). You can do same as step 2 for the Serbian currency.
Let me know, if you need any help.

HTML Purifier Codeigniter

I found several posts stating that xss_clean is not sufficient for sanitizing user input. Many of them suggested to use htmlpurifier in codeigniter.
I don't know what htmlpurifier exactly does and how it does. How to implement html purifier.
Please guide.
xss_clean actually isn't half bad, just don't expect it to be a magic bullet in the sense of 'I use xss_clean, now my whole website is secure'.
You still have to validate input and escape output. Simply put: you have to maintain control over what people can enter in your website, and you shouldn't trust anything that is in your database, so you escape the data before you use it or show it. If you use xss_clean and form validation for sanitizing the input and you escape the output before doing anything with it or showing it, you should be just fine.
Good reads:
Codeigniter xss_clean dilemma
and
http://codeigniter.com/forums/viewthread/188698

#Url.Content not encoding text - ASP.NET MVC with Razor

I need to build an url like this: /products/myproductdescription/5; it works except when the product description contains a "/".
I build the link with razor in this way:
#product.Description
I thought that using #product.Description would encode the description, but I get a link with the "/" if it is present in the description.
I tried this way also:
#product.Description
but the result is the same ...
Someone can tell me why that part of the link is not encoded?
Thank you.
You should avoid using special characters in the path portion of an url. You could use slugs and replace all dangerous characters. Here's for example how that's done on StackOverflow with the question titles in the url. In this case in order to be able to uniquely identify the resource always use an id. The description could only be used for SEO purposes.

How to remove special charecters in wordpress?

I am using Topsy, It returns me title of highest ranking article of my mebsite, It returns me one RSS file which contains post title with there link. For now i am only taking post name and using post title am trying to search in mysql database using following function like this:
get_post_by_title($postTitle,'post');
But the problem is topsy returns me post title but it also add some special characters in RSS file like " ' " replace with " ’ " this charecters.Because of this get_post_by_title() function does not return me post by title name.
EDIT : It returns me one post title like this :
iPad Applications In Bloom’s Taxonomy NEXT
Here single quote is special charecter.
Please help me. Thanks
First let's clear up a misconception: that character in your example is not a "special" character. It is Unicode code point U+2019, "RIGHT SINGLE QUOTATION MARK." Its HTML entity reference is ’. It's an ordinary character - it just happens to be an ordinary character that has no representation in ASCII. Before getting to an answer to your specific question, I need to tell you to read Joel Spolsky's article "The Absolute Minimum Every Software Developer Absolutely, Positively Must Know About Unicode and Character Sets (No Excuses!)" - it is just what it says on the tin, and unless you absorb at least a little more knowledge about Unicode, you will keep running into problems like this. Don't fret too much: everyone runs into problems like this until they learn how to deal with text. Unicode isn't "hard" so much as it is "prone to exposing unconscious assumptions we make about how text works." †
Now, to your question.
If I'm reading you right, what's happening to you is that you have posts with non-ASCII characters in their titles such as ’ which aren't showing up when you search for them with get_post_by_title() (it seems like you're using something similar to the accepted answer on this question - is that right?) There are two paths to a solution: store the titles in a format that's easier for you to search, or use a searching method that can find non-ASCII characters.
Storing the titles differently would require that you run them through PHP's built-in htmlentities() function or before storing them in your Wordpress DB - you would also want to make sure that you convert characters with no HTML entity equivalent to '\xNN' form, and to make sure that your DB's collation/charset is set to UTF-8 or another Unicode-aware encoding. This will be a nontrivial amount of effort. ‡
Using a different searching method doesn't require tinkering with your DB or digging into WordPress internals, but it does require very careful fiddling with search string. You'll need to either use the exact character you're looking for in a search, expressed as a '\xNN' character reference if necessary, or use wildcards carefully in the search.
Either way, good luck. It may be possible to offer more specific advice if more of your code is visible.
†: By the way, your life with regards to Unicode will also get much, much easier if you use better languages than PHP and better databases than MySQL. WordPress is inextricably tied to PHP and MySQL: PHP & MySQL are both woefully, horrendous, hilariously bad at handling Unicode issues correctly. Your life as a programmer will get better if you extirpate PHP & MySQL from it.
‡: Seriously, PHP is atrociously bad at this, and MySQL is in a shoelaces-tied-together state of fumbling. Avoid them.
remove from wp-config.php
//define('DB_CHARSET', 'utf8');
//define('DB_COLLATE','utf8_unicode_ci');
You can easily remove special characters using preg_replace, see this post -> http://code-tricks.com/filter-non-ascii-characters-using-php/

Resources