Reverse string stock (Unicode safe)
Anyone got an idea on how to make a stock that is unicode safe?
edit: I found something on a website, but, it is for C. http://rosettacode.org/wiki/Reverse_a_string#C Can this be converted? I couldn't understand a thing of it edit2: I succeeded in something, it is ineffecient, but working at least for now :) In case someone needed it (Not sure if it would work on all unicode characters)
Spoiler
** Still in need of a good way to reverse a string ... |
Re: Reverse string stock (Unicode safe)
Ps. ??
PHP Code:
PHP Code:
|
Re: Reverse string stock (Unicode safe)
Quote:
|
Re: Reverse string stock (Unicode safe)
Try this (for utf-8 only) :
This supposes the string is well encoded. Based on : http://en.wikipedia.org/wiki/UTF-8 PHP Code:
|
Re: Reverse string stock (Unicode safe)
I guess it is working, but not correctly (I guess).
From the link you gave, according to the table (first one), arabic letters use 3 bytes (cells), but your stocks thinks that they use only 2 bytes (cells) Either the hex values are wrong, or my string is completely ruined? :3 Thanks for trying to help me though. :bee: |
Re: Reverse string stock (Unicode safe)
My stock is trying to find if the utf-8 letter uses 2, 3 or 4 cells.
So, there are some errors ? |
| All times are GMT -4. The time now is 23:21. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.