By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,047 Members | 1,253 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,047 IT Pros & Developers. It's quick & easy.

Help: Need function to translate windows-874 to UTF-8

P: n/a
Hello all!

I'm in need of an algorithm to change windows-874 (Thai) encoding to
UTF-8, without using PHPs iconv or similar functions. I've done the
requisite googling and searching through the notes on php.net but nothing
(that I could see) has turned up.

Right now I'll be looking for pages explaining the inner workings of
windows-874 in the hopes that I might be able to code the algorithm
myself, but I thought I'd ask here as a last desperate hope :)

Any programming language is fine. I'll just translate it to PHP.

Yours in hope,
Grey

[x-posted to comp.lang.php 'cause I hear you guys are great, even though I
don't subscribe :) Please reply in a.w.w, thanks.]
Jul 17 '05 #1
Share this Question
Share on Google+
10 Replies


P: n/a
GreyWyvern <SP*********@greywyvern.com_am> wrote:
I'm in need of an algorithm to change windows-874 (Thai) encoding to
UTF-8, without using PHPs iconv or similar functions.
Sounds silly... Why not use these excellent tools in PHP.

[thais -> utf8] Any programming language is fine. I'll just translate it to PHP.


Take a look at the iconv source, it's open and it's free. If it supports
your source encoding, an alogorithm (or more likely a table) can be
gotten there.

--

Daniel Tryba

Jul 17 '05 #2

P: n/a
On Tue, 27 Apr 2004 13:14:02 +0000 (UTC), Daniel Tryba
<ne********************@canopus.nl> wrote:
GreyWyvern <SP*********@greywyvern.com_am> wrote:
I'm in need of an algorithm to change windows-874 (Thai) encoding to
UTF-8, without using PHPs iconv or similar functions.


Sounds silly... Why not use these excellent tools in PHP.

[thais -> utf8]
Any programming language is fine. I'll just translate it to PHP.


Take a look at the iconv source, it's open and it's free. If it supports
your source encoding, an alogorithm (or more likely a table) can be
gotten there.


I would if I could, and I've actually asked my host to install these
libraries. But for the sake of backward compatibility, and since iconv is
a relatively new PHP function in the scheme of things, and since I need
this algorithm for a script which will be distributed to multiple servers
with varying versions of PHP, I need a catch all translation which will
work always. Or at least back until 4.0.x

Thanks for you response, tho.

Grey
Jul 17 '05 #3

P: n/a
GreyWyvern <SP*********@greywyvern.com_am> wrote:
[thais -> utf8]
Any programming language is fine. I'll just translate it to PHP.


Take a look at the iconv source, it's open and it's free. If it supports
your source encoding, an alogorithm (or more likely a table) can be
gotten there.


I would if I could, and I've actually asked my host to install these
libraries. But for the sake of backward compatibility, and since iconv is
a relatively new PHP function in the scheme of things, and since I need
this algorithm for a script which will be distributed to multiple servers
with varying versions of PHP, I need a catch all translation which will
work always. Or at least back until 4.0.x


So what is keeping you from looking at the iconv source? You don't need
any php support for that :)

--

Daniel Tryba

Jul 17 '05 #4

P: n/a
GreyWyvern wrote:
Hello all!
hello again.
I'm in need of an algorithm to change windows-874 (Thai) encoding to
UTF-8, without using PHPs iconv or similar functions. I've done the
requisite googling and searching through the notes on php.net but
nothing (that I could see) has turned up.

Right now I'll be looking for pages explaining the inner workings of
windows-874 in the hopes that I might be able to code the algorithm
myself, but I thought I'd ask here as a last desperate hope :)

Any programming language is fine. I'll just translate it to PHP.


OK, if you aren't going to hit the PHP iconv C source to find it, how
about some Perl?

http://search.cpan.org/~elizabeth/Ne...NVERT_TO_UTF-8

....of particular interest to you:
"windows874 convert from windows-874 to UTF-8"
"illegal_windows874 remove characters illegal for windows-874"

Probably not exactly what you are looking for, but you may be able to
find what you need in here....

You can view the source directly here:
http://search.cpan.org/src/ELIZABETH...Trieve/UTF8.pm

HTH - and yes, c.l.php is great! :P

--
Justin Koivisto - sp**@koivi.com
PHP POSTERS: Please use comp.lang.php for PHP related questions,
alt.php* groups are not recommended.
SEO Competition League: http://seo.koivi.com/
Jul 17 '05 #5

P: n/a
On Tue, 27 Apr 2004 13:34:25 +0000 (UTC), Daniel Tryba
<ne********************@canopus.nl> wrote:
So what is keeping you from looking at the iconv source? You don't need
any php support for that :)


I am, actually. But searching through 15MB of code to find out how the
functions I need work together takes time ;)

Grey

--
The technical axiom that nothing is impossible sinisterly implies the
pitfall corollory that nothing is ridiculous.
- http://www.greywyvern.com - Orca Knowledgebase: Completely CSS styleable
Knowledgebase/FAQ system
Jul 17 '05 #6

P: n/a
On Tue, 27 Apr 2004 13:50:38 GMT, Justin Koivisto <sp**@koivi.com> wrote:
OK, if you aren't going to hit the PHP iconv C source to find it, how
about some Perl?

http://search.cpan.org/~elizabeth/Ne...NVERT_TO_UTF-8

...of particular interest to you:
"windows874 convert from windows-874 to UTF-8"
"illegal_windows874 remove characters illegal for windows-874"


Awesome! Exactly what I needed! It's now translated to PHP and working
perfectly!

Thanks muchly muchly, man :D I owe you a beer.

Grey
Jul 17 '05 #7

P: n/a
GreyWyvern wrote:
On Tue, 27 Apr 2004 13:50:38 GMT, Justin Koivisto <sp**@koivi.com> wrote:
OK, if you aren't going to hit the PHP iconv C source to find it, how
about some Perl?

http://search.cpan.org/~elizabeth/Ne...NVERT_TO_UTF-8
...of particular interest to you:
"windows874 convert from windows-874 to UTF-8"
"illegal_windows874 remove characters illegal for windows-874"

Awesome! Exactly what I needed! It's now translated to PHP and
working perfectly!

Thanks muchly muchly, man :D I owe you a beer.


No problem, but I believe that this would make 2 beers now. ;)

--
Justin Koivisto - sp**@koivi.com
PHP POSTERS: Please use comp.lang.php for PHP related questions,
alt.php* groups are not recommended.
Jul 17 '05 #8

P: n/a
On Tue, 27 Apr 2004 18:17:57 GMT, Justin Koivisto <sp**@koivi.com> wrote:
Thanks muchly muchly, man :D I owe you a beer.


No problem, but I believe that this would make 2 beers now. ;)


Really? What was the first one for? No matter, this one was worth at
least two anyway ;P

Grey
Jul 17 '05 #9

P: n/a
GreyWyvern wrote:
On Tue, 27 Apr 2004 18:17:57 GMT, Justin Koivisto <sp**@koivi.com> wrote:
Thanks muchly muchly, man :D I owe you a beer.

No problem, but I believe that this would make 2 beers now. ;)

Really? What was the first one for? No matter, this one was worth at
least two anyway ;P


PNG-24 transparencies... ;)

--
Justin Koivisto - sp**@koivi.com
PHP POSTERS: Please use comp.lang.php for PHP related questions,
alt.php* groups are not recommended.
Jul 17 '05 #10

P: n/a
On Tue, 27 Apr 2004 20:46:18 GMT, Justin Koivisto <sp**@koivi.com> wrote:
GreyWyvern wrote:
On Tue, 27 Apr 2004 18:17:57 GMT, Justin Koivisto <sp**@koivi.com>
wrote:
Thanks muchly muchly, man :D I owe you a beer.
No problem, but I believe that this would make 2 beers now. ;)

Really? What was the first one for? No matter, this one was worth
at least two anyway ;P


PNG-24 transparencies... ;)


Gah! 'tis true! Make it an even three then :)

Grey
Jul 17 '05 #11

This discussion thread is closed

Replies have been disabled for this discussion.