Showing posts with label MS DotNet. Show all posts
Showing posts with label MS DotNet. Show all posts

Monday, July 13, 2009

SQL Server with Unicode / Khmer Unicode characters

To be notice MS SQL supports only UCS-2 encoding so do not have encoding with UTF-8 as we expected as MySQL or some other database server as well. This means that you can't use UTF-8 character encoding with Microsoft SQL Server:

Here after I type Khmer Unicode and execute the query, I got question marks instead of characters:

So if you need to store national characters in Microsoft SQL Server - please consider using a national character encoding (U+1780 to U+17FF in Unicode/ISO10646 for Khmer Unicode characters, for example). Change data types:
  • varchar to nvarchar
  • text to ntext
  • char to nchar
Here is the example since I created a table and insert data:
1. Create database (mtr_db) as normally (default setting)

2. Create table (tblunicode) with two fields (id/name) but
name - data type nvarchar(MAX)


3. Insert Khmer Unicode and execute we got it as we typed!
Good luck!

Thursday, November 13, 2008

Software Development and Logging

Beside understanding programming language and programming model etc. We must know how to manage the message from the development for user, for developer etc. We called logging.

To manage log, we have many ways according to programming language and platform.

Normally, most of the developers neglect on logging during development parse and starting to expect the log files when an issue happens. That's why log management becomes very important for software development that we need to spend time to manage it as much as possible during development parse.

Log Management proceed into 4 levels:
1. Debug : this is a developer logging level. Should use it for any technical test or technical information that not requires to understand the business process.
2. Info : This is user logging level. Use it to describe the business process or information.
3. Warning: This log level is to focus on not mandatory missing element.
4. Error : Use this log level in case of technical or functional error.

There are many tools or add-on tool to help handling for various log management: (but I would suppose for open source project one, Apache)
- log4j : For Java
- log4Net : For MS DotNet
- log4PHP : For PHP
- log4plsql : For PL/SQL or SQLPlus of Oracle