Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    Senior Coder
    Join Date
    Dec 2005
    Location
    Slovenia
    Posts
    1,958
    Thanks
    120
    Thanked 76 Times in 76 Posts

    linux characters

    Have app, that worked on windows OK , mysql database ported to linux 5.1.31 --> 5.1.39
    on win worked ok, saved ‘čšž’ comed out as ‘čšž’, now it comes out as --> čšž

    looks the same (čšž) in mysql query browser on linux

    Code:
    CREATE TABLE  `test`.`tab_name` (
      ...
      `col_name` varchar(400) COLLATE utf8_slovenian_ci DEFAULT NULL COMMENT, 
        ..
    ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 COLLATE=utf8_slovenian_ci
    ‘čšž’ gets coruppted only via user input, what I manualy typed into datbase is OK.

    Thanks for tips.
    Last edited by BubikolRamios; 10-11-2009 at 06:31 PM.

  • #2
    Senior Coder
    Join Date
    Dec 2005
    Location
    Slovenia
    Posts
    1,958
    Thanks
    120
    Thanked 76 Times in 76 Posts
    if I go with this , before saving to database:

    java code:
    Code:
               p3 = p3.replace("ž", "ž");
               p3 = p3.replace("Ž", "Ž");
               
               
               p3 = p3.replace("č", "č");
               p3 = p3.replace("Œ", "Č");
               
               
               p3 = p3.replace("š", "š");
               p3 = p3.replace(" ", "Š");
    then its ok, but this is not the way to do it I presume.

  • #3
    Master Coder
    Join Date
    Apr 2003
    Location
    in my house
    Posts
    5,211
    Thanks
    39
    Thanked 201 Times in 197 Posts
    I'm guessing here but, is your webpage charset the same as your db? maybe it needs to be to avoid that difficulty?

    bazz
    "The day you stop learning is the day you become obsolete"! - my late Dad.

    Why do some people say "I don't know for sure"? If they don't know for sure then, they don't know!
    Useful MySQL resource
    Useful MySQL link

  • #4
    Senior Coder
    Join Date
    Dec 2005
    Location
    Slovenia
    Posts
    1,958
    Thanks
    120
    Thanked 76 Times in 76 Posts
    It is. As I said, the same thing works ok windows.

    in my.cnf-->

    Code:
    default-collation=utf8_slovenian_ci
    default-character-set=utf8
    on page-->
    Code:
    <%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%> 
    
    
    ...
    <head>
    ...
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta http-equiv="Content-Style-Type" content="text/css; charset=utf-8" />
    ...
    it gets wrong somewhere in the way from client to server, independant from database, as it looks like.

    mybe there is something like dos chcp on linux, that it matters here ?
    Last edited by BubikolRamios; 10-12-2009 at 07:41 AM.


  •  

    Posting Permissions

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