CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Jun 2004
    Posts
    142

    my dreaded french apostrophe

    hello

    (php and oracle environment)

    anybody know how to handle french apostrophe character.

    you will find an example of the caracter I mean here:
    http://wapedia.mobi/enwiktionary/apostrophe
    -scroll about half way down the page, look for the section "Punctuation"
    -it's the second one (most right) versions they show of the 2 versions under "apostrophe".

    My french entourage, alot of time copy and paste from Microsoft Word into a textarea box, then I insert into oracle database. It doesn't understand that char and turns it into an upside down question mark (¿ ). I tried to use find and replace with php but it doesn't work. I will probably need to refer to it by it's ascii definition, but not sure on how to do that. I even tried to trick it into doing the "ereg" replace of the "¿ " back into a normal apostrophe but that doesn't seem to work either.

  2. #2
    Join Date
    Jun 2004
    Posts
    142

    Re: my dreaded french apostrophe

    ok I found a better site for it
    http://www.fileformat.info/info/unic...2019/index.htm

    now at least I know the encodings' name for it, so how to I grab this when it's comming in raw, and tell it to convert to a normal apostrophe BEFORE I insert into the database?

  3. #3
    Join Date
    May 2002
    Posts
    10,943

    Re: my dreaded french apostrophe

    The only reason it won't work naturally is if the page's encoding or the database/table/column encoding is not compliant. Make sure all 4 are UTF-8 and you won't have a problem.
    Last edited by PeejAvery; May 12th, 2010 at 05:04 PM. Reason: Spelling
    If the post was helpful...Rate it! Remember to use [code] or [php] tags.

  4. #4
    Join Date
    Jun 2004
    Posts
    142

    Re: my dreaded french apostrophe

    it's just that I don't always have control over the database/table/column format.

    could I not somehow do something like this:
    $textarea = (whatever php fuctions that converts into a html entity)
    then use: ereg_replace('’", "whateverItIS", $textarea)

    ($textarea could be a long paragraph)

    let me guess... if it's not UTF 8 it already doesn't know what the hex encoding is or will give me the hex of the wrongly parsed character?
    Last edited by bobo; May 12th, 2010 at 02:37 PM.

  5. #5
    Join Date
    May 2002
    Posts
    10,943

    Re: my dreaded french apostrophe

    Quote Originally Posted by bobo View Post
    let me guess... if it's not UTF 8 it already doesn't know what the hex encoding is or will give me the hex of the wrongly parsed character?
    Correct.
    If the post was helpful...Rate it! Remember to use [code] or [php] tags.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured