Please login or register.

Login with username, password and session length
Advanced search  

News:

You need/want an older version of sNews ? Download an older/unsupported version here.

Pages: 1 2 [3]

Author Topic: Generate readable non-english SEF for all languages  (Read 11605 times)

Rui Mendes

  • Development,Testing, Support
  • Hero Member
  • *****
  • Karma: 195
  • Posts: 1009
  • sNews1.7
    • Comunidade Portuguesa
Re: Generate readable non-english SEF for all languages
« Reply #30 on: February 26, 2009, 10:44:52 pm »

Hello H.A.C.

I'm so sorry for my late response. Are you intersting to do this?

To do this you need the correct ascii code in hexadecimal format for each character.

Example: --> hexdecimal code is c0, use \x for 8 bits (FF) and \uFFFF for 16bits
Quote
str = str.replace(/[\xc0\u0386]/g,'a');
str = str.replace(/[\u0134\u0135]/g,'j');

Hope you can understand

Regards
Logged
Need a Job on Europe. Linkdin - Facebook / Group

asundrus

  • Newbie
  • *
  • Karma: 1
  • Posts: 20
Re: Generate readable non-english SEF for all languages
« Reply #31 on: April 27, 2009, 07:55:17 pm »

Hi.

First of, I have no idea on how you make these replaces, I tried searching for some info, but got lost
anyways, my problem is i've got two danish characters, not being replaced, those letters are:
and I hope you can read them, should be replaced with aa and with oe

I hope you can help me.
Logged

Keyrocks

  • Doug
  • ULTIMATE member
  • ******
  • Karma: 449
  • Posts: 6019
  • Semantically Challenged
    • snews.ca
Re: Generate readable non-english SEF for all languages
« Reply #32 on: April 27, 2009, 11:08:01 pm »

Hi. - First of, I have no idea on how you make these replaces, I tried searching for some info, but got lost. Anyways, my problem is i've got two danish characters, not being replaced, those letters are: and I hope you can read them, should be replaced with aa and with oe

I hope you can help me.

You might go back to the beginning of this thread and follow Rui Mendes's instructions about replacing the genSEF function... if you have not done that yet. Further down (under the first couple of posts), Rui also provides an Option 2 for capitals. It might be a good idea to read through the whole thread to get a good idea of what it's all about.  ;)
Logged
Do it now... later may not come.
-------------------------------------------------------------------------------------------------
sNews 1.6 MESU | sNews 1.6 MEMU

asundrus

  • Newbie
  • *
  • Karma: 1
  • Posts: 20
Re: Generate readable non-english SEF for all languages
« Reply #33 on: April 28, 2009, 12:00:21 am »

I already read the entire topic more than twice, and also replaced what he posted, but nothing helped me with the characters I mentioned.

*EDIT* I found the solution, the replace didnt replace correctly cause it was missing one letter in the characters I mentioned

Code: [Select]
str = str.replace(/[\xe0-\xe5\u0101\u0103\u0105\u0430]/g,'a');should have been:
Code: [Select]
str = str.replace(/[\xe0-\xe5\u0101\u0103\u0105\u0430]/g,'aa');
and:
Code: [Select]
str = str.replace(/[\xf2-\xf6\xf8\u014d\u0151\u043e]/g,'o');should have been:
Code: [Select]
str = str.replace(/[\xf2-\xf6\xf8\u014d\u0151\u043e]/g,'oe');after I made these changes everything is showing as it should.

« Last Edit: April 28, 2009, 12:16:51 am by asundrus »
Logged

Rui Mendes

  • Development,Testing, Support
  • Hero Member
  • *****
  • Karma: 195
  • Posts: 1009
  • sNews1.7
    • Comunidade Portuguesa
Re: Generate readable non-english SEF for all languages
« Reply #34 on: April 28, 2009, 04:24:41 pm »

Hello asundrus.

Thank you for share your choices.

I must say your changes will be only for danish and some other languages, not all languages.
I explain: Most languages use a standard ascii table, and are not compatible to other languages.

Anyway, I'm glad you could make it work for danish language.
Logged
Need a Job on Europe. Linkdin - Facebook / Group
Pages: 1 2 [3]