How to catch multi language's data in MSSQL and data isn't garbled

Hi everyone, I'm Taiwanese PHP developer, sorry for my poor English.
I have 3 language's data:Simplified Chinese,Traditional Chinese, and English in our mssql2012 database.
If I want to use ADODB to catch data,The Simplified Chinese and Traditional Chinese will be garbled.
I try to use mb_convert_encoding($data,
'UTF-8','BIG-5'),
the Traditional Chinese is ok, but Simplified Chinese is still garbled.
Do anyone have suggestion?
This is my output:
Array
[0] => Array
[0] => ZHS2
[1] => ?体中文
[2] => 123
[1] => Array
[0] => ZHS3
[1] => 翻?
[2] => 123
[2] => Array
[0] => ZHS
[1] => ?体中文
[2] => Chinese Simplified
[3] => Array
[0] => ZHT
[1] => 繁體中文
[2] => Chinese Traditional
[4] => Array
[0] => US
[1] => English
[2] => English US
Here is my code:
<?php
include('adodb5/adodb.inc.php');
function encoding_data($results){
foreach($results as $key1 => $result){
foreach ($result as $key2 => $arr_str){
if(is_integer($key2)){
//unset($results[$key1][$key2]);
//echo $key2."=>".$arr_str."<p />";
}else{
//echo $key2."=>".$arr_str."<p />";
$results[$key1][$key2] = mb_convert_encoding($arr_str, 'UTF-8','BIG-5');
$results[$key1][$key2] = mb_convert_encoding($arr_str, 'UTF-8', 'BIG-5');
return $results;
$sql = $_REQUEST['sql'];
$usedb = $_REQUEST['usedb'];
if($sql==""){
$sql = "select * from HCP";
if($usedb == ""){
$usedb ="oci8";
if($usedb == "mssql"){
$hostname = "Driver={SQL Server};Server=XXXX,XXXX;Database=XXXX;CharacterSet=UTF-8;UID=XXXX;PWD=XXXX";
//$port = XXXX;
$dbname = "XXXX";
$username = "XXXX";
$pw = "XXXX";
$mssqlconn = &ADONewConnection ('odbc_mssql');
//define connection string, specify database driver
$mssqlconn->Connect($hostname, $username, $pw , $dbname);
$mssqlconn->debug = false;
$results = $mssqlconn->GetArray($sql);
$results = encoding_data($results);
echo "<pre>",print_r($results),"</pre>";
print_r($usedb);
?>

Hi Yun Chen,
Not knowledgable on PHP programing, but as far as I know The BIG-5 is specific for traditional Chinese, so that's why you got garbled character for simplified Chinese.
As the Chinese character encoding wiki says, there're newer standards such as
GB18030 and
Unicode which have separate code points for both simplified and traditional characters. I believe this may be a good starting for you to make the conversion work.
Regarding your description, this is not some specific question on SQL Server. I would suggest you post your question on a dedicated PHP forum. It is more appropriate and more experts will help you.
If you have any question, feel free to let me know.
Eric Zhang
TechNet Community Support

Similar Messages

  • How to install multi language in Portal?

    Hi,
    Can someone give me the directions in how to install multi
    language in Portal? I found the "langinst.cmd" file under
    ORACLE_HOME\portal30\admin\plsql, also another
    file "langinst.sql" under ORACLE_HOME\portal30
    \admin\plsql\nlsres.
    I am not quite sure how I can do that, which file I should use.
    And once I installed the multi language, can I just go into
    portal to create a new content area and using the multi language?
    Thanks for any comment in advance!
    Kelly.

    Hi Kelly
    You need to identify parameters for this file and run file. Its
    langinst.cmd for WINNT and langinst.csh for UNIX.
    1.     From the dos prompt , go to the following directory on
    your server.
         Oracle/iSuites/portal30/admin/plsql/
    2.     Set the Oracle_Home to = oracle/iSuites/
    3.     Run the command
    langinst.csh -s portal30 -p portal30 -o
    PORTAL30_SSO -d PORTAL30_SSO -c oid -l ar -available
    s - schema
    p - password
    o - < login server - in your case it may be portal30_SSO >
    d - <password- maybe portal30_sso>
    c - connect string
    l - language (which is set to ar )
    ar is arabic which i ve set
    Good Luck
    Regards
    Yogesh

  • How to catch the error occurred in Integration Process, and then save it?

    1. how to catch the error occurred in Integration Process, and then save the detailed error message to the file?
    2. there are fault message type for inbound message interface, how to use the fault message type in IR?
    Thanks,
    Michael
    Message was edited by: Spring Tang
    inital
    Message was edited by: Spring Tang
    detailed message output
    Message was edited by: Spring Tang
    fault message type

    Hi Spring,
    If u give an exception step along with your Transformation Step, whenever some error occurs in your message mapping, this exception block wil be triggered.
    You can configure your exception block to do all exception processing that you want. This exception handling is like any other java Exceptio n Handler. You can do anything that you want in your exception handler block on the basis of your requirements.
    <i>If an exception is triggered at runtime, the system first searches for the relevant exception handler in surrounding blocks. If it does not find the correct exception handler, it continues the search in the next block in the block hierarchy.
    When the system finds the correct system handler, it stops all active steps in the block in which the exception handler is defined and then continues processing in the exception handler branch. Once the exception handler has finished processing, the process is continued after the block.
    If the system fails to find an exception handler, it terminates the integration process with an error.</i>
    Regards,
    Bhavesh

  • How to catch event before retrieving data in table?

    Hello
    I use Oracle JDeveloper 11.1.1.2.0
    I need to set parameters session (Package Vars) before any refresh my page (I retrieve data from views that use this vars).
    For this reason I have created method setUserSessionParameters(int[] parameters) in AppModuleImpl.java and I am able to call it from my backing bean.
    It's working fine, but I need to call it before any retrieving data in my tables.
    May be, there is a usual way to catch event before retrieving data is started?
    I'd call my method in that place. I think it would be perfectly well decision.

    Hi,
    you can define a PhaseListener method on the f:view component (it has pre and post properties for this). In the after RestoreView phase, you can access the binding container and call teh AM method to set the values. This way, before the page renders, the value is set
    Frank

  • How to disable the Language dependent option for 0PROJECT and 0WBS_ELEMT

    Hi Friends,
                Some Info Objects are re installed in latest version that's why DBW and QBW is not sinked. that's why giving transports errors.
               In DBW both Info Objects(0PROJECT and 0WBS_ELEMT) having the option text language dependent is checked. I go for disable that option it is not accepting to disable.
              when i am going to delete the data from both the info objects it's not deleting the data from both the objects. it is giving message some master data is not deleting.
           Please give me solution for this how to disable text language dependent option for both the objects.
       I am waiting for your valuable replies.
    Thanks,
    Guna.

    Hi Rajesh,
              i did that changes in RSD1 but not accepting that change.
    It is showing the error message for The Text Table /BI0/TPROJECT must be converted incompatibly with an activation of characteristic 0PROJECT (changes to the key in the table). Table /BI0/TPROJECT contains data. Parts of this data were lost in the conversion.
    Please give me help for solving this issue.
    Thnaks,
    Guna.
    Edited by: gunasekhar raya on Mar 24, 2009 11:58 AM
    Edited by: gunasekhar raya on Mar 24, 2009 5:42 PM
    Edited by: gunasekhar raya on Mar 24, 2009 5:43 PM

  • How to specify The Language in Which Siebel Installers and Wizards Run

    Hi,
    Yes (i think) i have read all about it in the manuals, but cannot find the solution to my problem :-(
    I am currently installing Siebel SBA 8.1.1.0 on a Windows 2003 SP2 server. This server has the following regional and language settings;
    - regional options - standards and formats : Dutch (Netherlands)
    - Location : Netherlands, the
    - Languages : Default input language English - US
    The following environment variables are set;
    system variable LANG=ENU
    system variable SIEBEL_LANGUAGE=ENU
    When starting any installer or wizard using the arguments "-args LANG=ENU" the installer or wizard language is still Dutch. Both in GUI as in Console Mode.
    Currently i am only able to start the installers or wizards in English when the regional options are changed. I could not find any issues on metalink, google etc.
    Does anybody have a way to to start the installers in a specific language without having to modify the regional options ?
    Thanks in advance,
    Peter

    Thank you for your answer ... but read the full summary next time please...
    For other people that have the same problem, I've figured it out by now:
    1) The language you select in the creative cloud packager is not for the Creative Cloud App, only for the applications you package
    2) The Creative Cloud App Language is set by the language of the OS ... this has nothing to do with the Creative Cloud Packager
    3) When the Creative Cloud App starts in a specific language ... only the packages installed for this language are detected
    4) If you want to change the language of the Creative Cloud App and you had packages installed under the previous language, you have to download (or install) them again under the current language to be visible / updatable again under the current language
    For me this means:
    option1: I package all the applications in dutch (since all CC for teams applications are multilanguage)
    option2: I notify all users (or use active setup or any other alternative) to manually change the language to english ... otherwise no packages will be visible

  • How to insert multi language data to oracle database

    Hi ,
    Can any one suggest the steps involved in implementing storage/retrieval of data in the language otherthan english on the database?. I am using Oracle 9i database.
    I want to write sql scripts to insert data to the database.How can i insert the data in the language otherthan english i.e hindi. ensuring storage and display of data is fine at the backend.
    CHARACTERSET is set AL32UTF8 and need to insert the data in the NVARCHAR2 datatype enabled column.
    Any suggestions would be greatly appreciated.
    Thanks and Regards,
    Poornima

    If you can write the text in Notepad, then enter the text and save the file with the encoding "Unicode big endian". Then, open the file in a hex editor. The first two bytes will be 0xFE and 0xFF (this is the Byte Order Mark). This code should be skipped for database storage as it is relevant to flat files only. What follows are two-byte character codes that you can put into UNISTR calls. The file with the word "Patra" will show up in the hex editor as:
    FE FF 09 2a 09 24 09 4d 09 30
    If you can enter the characters in your HTML browser, you can use the very useful conversion page at http://rishida.net/tools/conversion/ (this is not an official endorsement from Oracle but my personal advice). Enter the characters into the "Characters" text area and click on the corresponding [Convert] button. The "Hexadecimal code points" field will tell you the codes that you need to prefix with backslash and put into the UNISTR call.
    If you are unable to enter the characters on your workstation, then you can identify each letter in the text and look it up in the Unicode character database at http://www.unicode.org/Public/UNIDATA/Index.txt or http://www.unicode.org/Public/UNIDATA/NamesList.txt. The four-digit hexadecimal codes listed there are what you are looking for. Unfortunately, such lookup will not work for Chinese Han and Japanese Kanji characters as they have no names in Unicode.
    Another method is to use files in another language-specific encoding and convert them to Unicode before loading them into the AL32UTF8 database.
    -- Sergiusz

  • SQL*Loader: How to load multi-line report data?

    Hi,
    is it possible to use SQL*Loader to load data from a hierarchical structured fixed column ASCII file like this
    001 scott
    New York 01.01.2002 1234
    Chicago 15.10.2001 9876
    002 smith
    Los Angeles 24.12.1999 5678
    Washington 01.12.1999 0000
    Chicago 01.01.2000 1111
    into one database table:
    id name city day code
    001 scott New York 01.01.2002 1234
    001 scott Chicago 15.10.2001 9876
    002 smith Los Angeles 24.12.1999 5678
    002 smith Washington 01.12.1999 0000
    002 smith Chicago 01.01.2000 1111
    The number of lines per name is unlimited, the next line starts after a separating ---- line.
    We cannot change the format of the text file to import.
    There is an example in the documentation that shows how to load a structure like the following via insert triggers:
    001 scott New York 01.01.2002 1234
    Chicago 15.10.2001 9876
    002 smith Los Angeles 24.12.1999 5678
    Washington 01.12.1999 0000
    Chicago 01.01.2000 1111
    But we have the name information on a separate header line, so I don't know if we can use a similar technique here.
    regards
    Sven

    Try enclosing your strings with e.g. a double-quote. To do so, the control file needs the following (example):
    LOAD DATA
    REPLACE
    INTO TABLE test          
    FIELDS TERMINATED BY '|' OPTIONALLY ENCLOSED BY '"'
    TRAILING NULLCOLS
    id1,
    id2,
    id3,
    id4,
    )of course this does mean that your data must change...
    L.

  • How to enable multi-language support in JAVA

    i want to make an application whose language will be URDU but how to enablw urdu or any non-english language characters in java.plz help.i am an SCJP.

    The partial answer is that you use fonts that can display those characters. But you may also have to address how to enter them from the keyboard, how to store them in databases, how to transmit them via HTTP... depending on your actual requirements.
    Start with the "Internationalization" tutorial that is referenced here: http://java.sun.com/docs/books/tutorial/

  • How to provide multi language to application?

    Dear All,
    I want to save some values as multilanguage.
    There are my solutions:
    my database table is:
    language:
    1. ID
    2. Name
    property:
    1. ID //DBSequence
    2. Code
    propertyml:
    1. Property_id
    2. Language_id
    3. Name
    4. Description
    my form:
    [Create Insert button]
    Code: inputText
    Language: selectOneChoise
    Name: inputText
    Description: inputText
    [save button]
    But I'm facing problem.
    How to save one moment "property" and "properyml" entity to database? Because when createinsert moment we don't have "ID of property table", i can't give property_id to propertyml table.
    First i commit property entity to db, it is OK. But one moment, i haven't no idea.
    I attached my application without sql script.
    My project: http://www.4shared.com/file/_DkeiyY5/MultiLanguage.html

    Hello,
    You should first have an association between tour property and propertyml entities.
    Then you need to create a VO With property entity.
    Then add propertyml entity and check updatable
    In attributes and the propertyml fields you want to file.
    into you entity association, don't forget to check composition association and cascade update key attributes into relationship tab (*behavior*)
    This will managed your created property id into your propertyml.
    I hope this help.
    Jack

  • How to design multi-languages site?

    Hi:
    I try to store user profile in the database. Since chinese is double
    byte, and english is not.
    Does anyone tell me what is advantage and disadvantage to choose
    defining a user table for all the users or to defining two tables,
    one for double byte user, one for english user?
    Thanks in advance.
    li

    hello,
    there are several ways to do it. i guess the most practical way is to actually use the XML customization feature that is available with reports or use translation hub, but since you stated that you are using 6i this is not an option as translation hub is only available from 9i onwards.
    however the XML customziation approach would work for 6i as well. essentailly you create your report and make sure all your boilerplate text items have a uniqe name. then you can create a customization file for each language that then changes the content of each of the poilerpalte items. those can be applied at runtime or in batch.
    as for the scheduling, you would need to either pass in a parameter naming the customization file or simply run the correct language version of the report.
    thanks,
    ph.

  • How to have multi select dropdowns for web request and adobe forms

    Hi All,
    I am working on interactive forms for CRM 7.0 using web request and ZCI layout.
    When I say web request we define the fields required for the form in CRM that becomes the context for WDA and passed onto Adobe form.
    This web request is a flat structure which mean if I have a node and attributes with in that you cant have multiple values to wards this node as in WDA.
    Now My query:
      I have a field called "xyz" since web request is a flat structure i just defined it as a string.
      In WDA I made it a enumrated field and added key value pairs to it.
      In Adobe form I binded this field to a WD native enum dropdown list every thing is fine untill here.
      Now in the form I need this as a multiple select, so i changed the dropdown field to list box it works.
      The form has to be submitted as a draft version when did so, it will not execute any APIs but saves the data to the web request.
      When the same form is opened for the next time, with the data in web request it should reopen this field with the multiple seleced values high lighted.
      since the field xyz is a single filed of string, how can i maintain multiple values in that...?
      if there is a form status auto save function in Adobe form this might solve a bit but not sure when the form is opened 2nd time from web reqest view does it consider it as a new one or open the same form...?
    I have such dropdown fields and problems including ones with depenedt values on one another.
    I tried my best to explain the problem, if somebody can help me with this its much appriciated.
    Note: Since this is dependent on CRM web request I am posting the same query in that block also apologies if this mean a duplicacy.
    Thanks & Regards,
    Sai

    I got the solution and problem is solved.
    Iterating & processing a enumrated dropdown is like any other dropdown /list box in adobe forms.
    Regards,
    Sai Krishna

  • Multi language objects within transaction PPOSE and PPOME

    Dear guys,
    we have a global SAP OM system where we receive data from local SAP systems in different languages.
    On our global SAP system we log into English and therefore we can only see the objects which were created or translated into english. Is anybody aware of a switch or something else which we can use to set the system in a way that all objects will be shown in transaction PPOSE per deafult in English but if no translation is available for an object in the available language (e.g. german).
    Any idea or hint?
    Best regards
    Walter

    Check with Language Key option in IT 1000 Object ......You can store object in selected language ....
    Check with this thread also : [OM:  Translation of Objects;
    Mohan

  • How to enable NLS languages after installation in R12 and 11i

    Hi,
    We were having a R12.1.3 with NLS supplement media with us. We have installed it on on one of our development server.
    We have selected 14 languages at the time of installation.And after installation when the login page appeared , we were able to see all the languages but only English is enabled.Rest other languages were disabled.
    Question 1: Steps to enable rest of the languages in R12 and 11i environments.Is there any relation with localisations?
    Question 2: How patches(one off , mini packs, family packs and maintainence packs) are applied for this type of environments.
    Detailed Steps required.
    Question 3: If only India localisation is in use do we require to apply patches for other languages as well at this point of time.
    Question 4. How CPU patches are applied for this type of enviroments.
    Regards

    We were having a R12.1.3 with NLS supplement media with us. We have installed it on on one of our development server.
    We have selected 14 languages at the time of installation.And after installation when the login page appeared , we were able to see all the languages but only English is enabled.Rest other languages were disabled.12.1.3 does not come as a fresh installation media pack (12.1.1 does!).
    Question 1: Steps to enable rest of the languages in R12 and 11i environments.Is there any relation with localisations?You need to add those languages via OAM -- Please see old threads for similar discussion http://forums.oracle.com/forums/search.jspa?threadID=&q=NLS+AND+R12&objID=c3&dateRange=all&userID=&numResults=15&rankBy=10001
    Question 2: How patches(one off , mini packs, family packs and maintainence packs) are applied for this type of environments.
    Detailed Steps required.You will have to apply the US patches as well as NLS patches (for all installed languages).
    Question 3: If only India localisation is in use do we require to apply patches for other languages as well at this point of time.If other languages are installed, then yes. Otherwise, you can just go with the US patches.
    Question 4. How CPU patches are applied for this type of enviroments.Same as any other installation except you have to consider applying the NLS patches for the application patches (Database and Developer/OracleAS 10g patches remain the same).
    Thanks,
    Hussein

  • Each time I click the "Open a New Tab" button, how do I make FF open to my homepage and why isn't this default behavior?

    Firefox does not default to your homepage when you manually open a new tab. It should do so.
    Is there a way to make FF do this? Is it an addon? If so, should this not be default behavior and just be incorporated into the browser?

    # Type ''about:config'' in Firefox's location bar
    # Find ''browser.newtab.url''
    # Double click on it
    # Paste your homepage link into the text box
    # Click ''Ok''

Maybe you are looking for

  • Creative Cloud Desktop fails to download certain applications.

    So basically what happens is I am able to click the button, and the progress bar appears, but it doesn't progress past 0%, and no 'X' button appears next to it. If I quit during this period, Creative Cloud Desktop doesn't load up again, and I'm force

  • When i connect my iphone 3g apperas usb and itunes icons and pc dont see it .

    i bought second iphone 3g , i deleted everything from it and now i connect it to pc and appears itunes and usb cable logo and nothing happens more pc dont even see this phone , i connect my another iphone 3g and and pc recognize it and everything wor

  • Flv files too big?

    i have three video files on my website. each is 1 minute long and each is just under 5 megs big. is this an acceptable size for the videos or are they still too big and require further compression? what is considered acceptable? i am finding that whe

  • How to print space as thousand seperator and comma as decimal seperator

    Hi All, I have requirement where I need to print the amounts with space as thousand seperator and comma as decimal seperator. I have a field wrshb which is of type mhnd-wrshb. currently I am printing this. In the adobe layout I have declared this col

  • (-69) Error when trying to upload songs on to iPod

    All of the sudden when I try to upload songs on to my iPod I get a messages that says, and I quote, "Attempting to copy to the disk "Rob's iPod" failed. An unknown error has occered (-69). I went to apple store thinking it was a problem with the hard