UNICODE UNICODE - 北京怡康軟件科技有限公司 資源網(wǎng) "/>

亚洲av色香蕉一区二区三区,十四以下岁毛片带血a级,亚洲 校园 欧美 国产 另类,亚洲av日韩av一区谷露,色欲av无码一区二区三区

  • 相關(guān)軟件
    >UNICODE 創(chuàng)建者:webmaster 更新時間:2006-02-16 15:51

    按照 Unicode 標準的定義,返回輸入表達式的第一個字符的整數(shù)值。



    語法


    UNICODE ( 'ncharacter_expression' )



    參數(shù)


    'ncharacter_expression'



    ncharnvarchar 表達式。



    返回類型


    int



    示例


    A. 使用 UNICODE 和 NCHAR


    下面的示例使用 UNICODE 和 NCHAR 函數(shù)打印 Åkergatan 24 字符串中第一個字符的 UNICODE 值,并打印實際的第一個字符 Å。



    DECLARE @nstring nchar(12)
    SET @nstring = N'
    Åkergatan 24'
    SELECT UNICODE(@nstring), NCHAR(UNICODE(@nstring))


    下面是結(jié)果集:



    ----------- - 
    197      
    Å


    B. 使用 SUBSTRING、UNICODE 和 CONVERT 函數(shù)


    下面的示例使用 SUBSTRING、UNICODE 和 CONVERT 函數(shù)輸出字符串 Åkergatan 24 中每個字符的字符號、Unicode 字符和 UNICODE 值。



    -- The @position variable holds the position of the character currently
    -- being processed. The @nstring variable is the Unicode character
    -- string to process.
    DECLARE @position int, @nstring nchar(12)
    -- Initialize the current position variable to the first character in
    -- the string.
    SET @position = 1
    -- Initialize the character string variable to the string to process.
    -- Notice that there is an N before the start of the string, which
    -- indicates that the data following the N is Unicode data.
    SET @nstring = N'
    Åkergatan 24'
    -- Print the character number of the position of the string you are at,
    -- the actual Unicode character you are processing, and the UNICODE
    -- value for this particular character.
    PRINT 'Character #' + ' ' + 'Unicode Character' + ' ' + 'UNICODE Value'
    WHILE @position <= DATALENGTH(@nstring)
    -- While these are still characters in the character string,
      BEGIN
      SELECT @position,
        CONVERT(char(17), SUBSTRING(@nstring, @position, 1)),
        UNICODE(SUBSTRING(@nstring, @position, 1))
      SELECT @position = @position + 1
      END


    下面是結(jié)果集:



    Character # Unicode Character UNICODE Value
                               
    ----------- ----------------- -----------
    1      
    Å           197      
                               
    ----------- ----------------- -----------
    2       k           107      
                               
    ----------- ----------------- -----------
    3       e           101      
                               
    ----------- ----------------- -----------
    4       r           114      
                               
    ----------- ----------------- -----------
    5       g           103      
                               
    ----------- ----------------- -----------
    6       a           97      
                               
    ----------- ----------------- -----------
    7       t           116      
                               
    ----------- ----------------- -----------
    8       a           97      
                               
    ----------- ----------------- -----------
    9       n           110      
                               
    ----------- ----------------- -----------
    10                   32      
                               
    ----------- ----------------- -----------
    11       2           50      
                               
    ----------- ----------------- -----------
    12       4           52
    相關(guān)文章
    本頁查看次數(shù):