~ubuntu-branches/ubuntu/utopic/gettext/utopic

« back to all changes in this revision

Viewing changes to gettext-tools/gnulib-lib/wcwidth.c

  • Committer: Colin Watson
  • Date: 2010-08-01 21:36:08 UTC
  • mfrom: (2.1.10 sid)
  • Revision ID: cjwatson@canonical.com-20100801213608-yy7vkm8lpatep3ci
merge from Debian 0.18.1.1-1

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* Determine the number of screen columns needed for a character.
2
 
   Copyright (C) 2006, 2007 Free Software Foundation, Inc.
 
2
   Copyright (C) 2006-2007, 2010 Free Software Foundation, Inc.
3
3
 
4
4
   This program is free software: you can redistribute it and/or modify
5
5
   it under the terms of the GNU General Public License as published by
26
26
#include "streq.h"
27
27
#include "uniwidth.h"
28
28
 
 
29
int
 
30
wcwidth (wchar_t wc)
29
31
#undef wcwidth
30
 
 
31
 
int
32
 
rpl_wcwidth (wchar_t wc)
33
32
{
34
33
  /* In UTF-8 locales, use a Unicode aware width function.  */
35
34
  const char *encoding = locale_charset ();
36
35
  if (STREQ (encoding, "UTF-8", 'U', 'T', 'F', '-', '8', 0, 0, 0 ,0))
37
36
    {
38
37
      /* We assume that in a UTF-8 locale, a wide character is the same as a
39
 
         Unicode character.  */
 
38
         Unicode character.  */
40
39
      return uc_width (wc, encoding);
41
40
    }
42
41
  else