Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Library not working #1

Open
timyounes opened this issue Jun 8, 2017 · 2 comments
Open

Library not working #1

timyounes opened this issue Jun 8, 2017 · 2 comments

Comments

@timyounes
Copy link

Hi,

I try this library but its not working

@mtojo
Copy link
Owner

mtojo commented Jun 9, 2017

I'm sorry the document is incorrect, the example code doesn't work.

The charset is specified by the name in the Camellia_Converter::availableCharsets() list. The values in this list are as follows:

camellia/converter.php

Lines 66 to 440 in 43b3c86

'alternativnyj',
'amiga-1251',
'ansel',
'armscii-7',
'armscii-8',
'armscii-8a',
'ast166-7',
'ast166-8',
'ast166-8a',
'atarist',
'atascii',
'baltic',
'big5-1984',
'big5-2003',
'big5-eten',
'big5-ext',
'big5-gccs',
'big5-hkscs-1999',
'big5-hkscs-2001',
'big5-plus',
'bulgarian-mik',
'cns11643-1986',
'cns11643-1992',
'cp037',
'cp038',
'cp154',
'cp256',
'cp273',
'cp274',
'cp275',
'cp277',
'cp278',
'cp280',
'cp281',
'cp284',
'cp285',
'cp290',
'cp297',
'cp420',
'cp423',
'cp424',
'cp437',
'cp500',
'cp708',
'cp720',
'cp737',
'cp775',
'cp806',
'cp833',
'cp838',
'cp849',
'cp850',
'cp851',
'cp852',
'cp853',
'cp855',
'cp856',
'cp857',
'cp858',
'cp860',
'cp861',
'cp862',
'cp863',
'cp864',
'cp865',
'cp866',
'cp868',
'cp869',
'cp870',
'cp871',
'cp874',
'cp875',
'cp880',
'cp904',
'cp905',
'cp918',
'cp922',
'cp924',
'cp942',
'cp943',
'cp948',
'cp949',
'cp950',
'cp954',
'cp964',
'cp1004',
'cp1006',
'cp1025',
'cp1026',
'cp1046',
'cp1047',
'cp1051',
'cp1098',
'cp1124',
'cp1125',
'cp1129',
'cp1131',
'cp1132',
'cp1133',
'cp1140',
'cp1141',
'cp1142',
'cp1143',
'cp1144',
'cp1145',
'cp1146',
'cp1147',
'cp1148',
'cp1149',
'cp1160',
'cp1161',
'cp1162',
'cp1163',
'cp1164',
'cp1361',
'cp1370',
'cp1381',
'cp1383',
'cp1386',
'cp5104',
'cp5478',
'cp20001',
'cp20002',
'cp20003',
'cp20004',
'cp20005',
'cp20105',
'cp20261',
'cp20269',
'cwi',
'dec-hanyu',
'dec-hanzi',
'dec-kanji',
'dec-mcs',
'dk-us',
'ds2089',
'ebcdic-at-de',
'ebcdic-at-de-a',
'ebcdic-ca-fr',
'ebcdic-dk-no',
'ebcdic-dk-no-a',
'ebcdic-es',
'ebcdic-es-a',
'ebcdic-es-s',
'ebcdic-fi-se',
'ebcdic-fi-se-a',
'ebcdic-fr',
'ebcdic-is-friss',
'ebcdic-it',
'ebcdic-pt',
'ebcdic-uk',
'ebcdic-us',
'euc-cn',
'euc-jis-2004',
'euc-jisx0213',
'euc-jp',
'euc-jp-ms',
'euc-kr',
'euc-tw',
'fieldata',
'gb2312',
'gb12345-90',
'gb18030',
'gbk',
'georgian-academy',
'georgian-ps',
'geostd8',
'gsm0338',
'hp-ccdc',
'hp-roman8',
'ia5-german',
'ia5-irv',
'ia5-norwegian',
'ia5-swedish',
'invariant',
'iscii-as',
'iscii-be',
'iscii-de',
'iscii-gu',
'iscii-ka',
'iscii-ma',
'iscii-or',
'iscii-pa',
'iscii-ta',
'iscii-te',
'isiri-3342',
'iso-646-basic',
'iso-646-irv',
'iso-2022-cn',
'iso-2022-cn-ext',
'iso-2022-jp',
'iso-2022-jp-1',
'iso-2022-jp-2',
'iso-2022-jp-3',
'iso-2022-jp-2004',
'iso-2022-kr',
'iso-5426',
'iso-6937',
'iso-6937-2',
'iso-8859-1',
'iso-8859-2',
'iso-8859-3',
'iso-8859-4',
'iso-8859-5',
'iso-8859-6',
'iso-8859-7',
'iso-8859-8',
'iso-8859-9',
'iso-8859-10',
'iso-8859-11',
'iso-8859-13',
'iso-8859-14',
'iso-8859-15',
'iso-8859-16',
'iso-8859-supp',
'iso-10646-ucs-2',
'iso-10646-ucs-4',
'iso-ir-4',
'iso-ir-8-1',
'iso-ir-8-2',
'iso-ir-9-1',
'iso-ir-9-2',
'iso-ir-10',
'iso-ir-13',
'iso-ir-14',
'iso-ir-15',
'iso-ir-16',
'iso-ir-17',
'iso-ir-18',
'iso-ir-19',
'iso-ir-25',
'iso-ir-27',
'iso-ir-37',
'iso-ir-47',
'iso-ir-49',
'iso-ir-50',
'iso-ir-51',
'iso-ir-54',
'iso-ir-55',
'iso-ir-57',
'iso-ir-60',
'iso-ir-68',
'iso-ir-69',
'iso-ir-70',
'iso-ir-84',
'iso-ir-85',
'iso-ir-86',
'iso-ir-88',
'iso-ir-89',
'iso-ir-90',
'iso-ir-91',
'iso-ir-92',
'iso-ir-93',
'iso-ir-94',
'iso-ir-95',
'iso-ir-96',
'iso-ir-98',
'iso-ir-99',
'iso-ir-102',
'iso-ir-103',
'iso-ir-111',
'iso-ir-121',
'iso-ir-122',
'iso-ir-123',
'iso-ir-128',
'iso-ir-139',
'iso-ir-141',
'iso-ir-142',
'iso-ir-143',
'iso-ir-146',
'iso-ir-147',
'iso-ir-150',
'iso-ir-151',
'iso-ir-152',
'iso-ir-153',
'iso-ir-155',
'iso-ir-165',
'iso-ir-197',
'iso-ir-202',
'iso-ir-209',
'jis_x0201',
'jis_x0201c',
'jis_x0208',
'jis_x0212',
'jis_x0213-2000-1',
'jis_x0213-2000-2',
'jis_x0213-2004',
'johab',
'koi7',
'koi8-i',
'koi8-r',
'koi8-ru',
'koi8-t',
'koi8-u',
'koi8-uni',
'ksc5601-1987',
'ksc5601-1992',
'ksc5636',
'ksx1001',
'latin-lap',
'mac-arabic',
'mac-ce',
'mac-celtic',
'mac-chinesesimp',
'mac-chinesetrad',
'mac-croatian',
'mac-cyrillic',
'mac-dingbat',
'mac-farsi',
'mac-gaelic',
'mac-greek',
'mac-hebrew',
'mac-icelandic',
'mac-inuit',
'mac-japanese',
'mac-korean',
'mac-roman',
'mac-romanian',
'mac-sami',
'mac-symbol',
'mac-thai',
'mac-turkish',
'mac-ukrainian',
'mulelao-1',
'nextstep',
'osnovnoj',
'petscii',
'petscii-shifted',
'posix',
'riscos-latin1',
'rk1048',
'seascii',
'shift_jis',
'shift_jis-2004',
'shift_jisx0213',
'spectrum-48k',
'stdenc',
'symbol',
'tcvn5712-1',
'tcvn5712-2',
'tds565',
'tis-620',
'tscii',
'ucode',
'us-ascii',
'us-ascii-quotes',
'us-dk',
'utf-1',
'utf-5',
'utf-7',
'utf-7-imap',
'utf-8',
'utf-8n',
'utf-16',
'utf-16be',
'utf-16le',
'utf-32',
'utf-32be',
'utf-32le',
'viqri',
'viscii',
'vni',
'vps',
'windows-31j',
'windows-1250',
'windows-1251',
'windows-1252',
'windows-1253',
'windows-1254',
'windows-1255',
'windows-1256',
'windows-1257',
'windows-1258',
'windows-sami-2',
'zdingbat',

I think will work with the following code:

require 'path/to/camellia/converter.php';
$string = 'String encoded by Shift_JIS.';
$conv = new Camellia_Converter;
$string = $conv->convert('shift_jis', 'utf-8', $string); // <- Charset specified in lowercase!
echo $string;

@timyounes
Copy link
Author

Thanks @mtojo I will try it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants