How to pass JSON UTF-8 from Smarty template to Open Flash Chart 2
Recently I ran into the problem with passing UTF-8 JSON from Smarty to Open Flash Chart 2. By default Smarty is striping slashes from all variables that it passes to the template, and JSON is converting every UTF-8 Character with ‘\u’ in the beginning. Of cause Smarty was returning only ‘u’.
To force Smarty to pass variables with slashes you can do next:
1 |
After that $chart will have correct JSON with correct UTF-8 Characters
Howto install rails on Ubuntu 8.04 LTS Server
If you have Ubuntu 8.04 LTS Server and you are installing rails from gem, you most propbably will run into the problem when rack will need thin and thin will need rack and this will create infinitive loop. There is a very simple and fast fix for it. All you have to do is update RubyGems. Please keep in mind that update will remove all your installed gems and you will have to install it once again.
sudo gem update --system
Then you have to remove old gem file from /usr/bin and link it to newer one.
1 2 | sudo mv /usr/bin/gem /usr/bin/gem.bak sudo ln -s /usr/bin/gem1.8 /usr/bin/gem |
After that you should be able to install Rails with following command:
sudo gem install rails
Happy coding!