mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
UTF8
- Merged libexpr changes.
This commit is contained in:
parent
2c2e94bb0f
commit
57106c86a9
3 changed files with 14 additions and 6 deletions
|
@ -1,7 +1,6 @@
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
// taskwarrior - a command line task list manager.
|
|
||||||
//
|
//
|
||||||
// Copyright 2006-2013, Paul Beckingham, Federico Hernandez.
|
// Copyright 2013 - 2014, Paul Beckingham, Federico Hernandez.
|
||||||
//
|
//
|
||||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
// of this software and associated documentation files (the "Software"), to deal
|
// of this software and associated documentation files (the "Software"), to deal
|
||||||
|
@ -25,6 +24,7 @@
|
||||||
//
|
//
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#include <cmake.h>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <text.h>
|
#include <text.h>
|
||||||
#include <utf8.h>
|
#include <utf8.h>
|
||||||
|
@ -78,6 +78,9 @@ unsigned int utf8_codepoint (const std::string& input)
|
||||||
// - returns the next character
|
// - returns the next character
|
||||||
unsigned int utf8_next_char (const std::string& input, std::string::size_type& i)
|
unsigned int utf8_next_char (const std::string& input, std::string::size_type& i)
|
||||||
{
|
{
|
||||||
|
if (input[i] == '\0')
|
||||||
|
return 0;
|
||||||
|
|
||||||
// How many bytes in the sequence?
|
// How many bytes in the sequence?
|
||||||
int length = utf8_sequence (input[i]);
|
int length = utf8_sequence (input[i]);
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
// taskwarrior - a command line task list manager.
|
|
||||||
//
|
//
|
||||||
// Copyright 2006-2013, Paul Beckingham, Federico Hernandez.
|
// Copyright 2013 - 2014, Paul Beckingham, Federico Hernandez.
|
||||||
//
|
//
|
||||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
// of this software and associated documentation files (the "Software"), to deal
|
// of this software and associated documentation files (the "Software"), to deal
|
||||||
|
@ -40,6 +39,7 @@ unsigned int utf8_width (const std::string& str);
|
||||||
unsigned int utf8_text_width (const std::string&);
|
unsigned int utf8_text_width (const std::string&);
|
||||||
const std::string utf8_substr (const std::string&, unsigned int, unsigned int length = 0);
|
const std::string utf8_substr (const std::string&, unsigned int, unsigned int length = 0);
|
||||||
|
|
||||||
|
int mk_wcwidth (wchar_t);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
// taskwarrior - a command line task list manager.
|
|
||||||
//
|
//
|
||||||
// Copyright 2006-2013, Paul Beckingham, Federico Hernandez.
|
// Copyright 2006 - 2014, Paul Beckingham, Federico Hernandez.
|
||||||
//
|
//
|
||||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
// of this software and associated documentation files (the "Software"), to deal
|
// of this software and associated documentation files (the "Software"), to deal
|
||||||
|
@ -25,7 +24,9 @@
|
||||||
//
|
//
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#include <cmake.h>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
#include <stdlib.h>
|
||||||
#include <utf8.h>
|
#include <utf8.h>
|
||||||
#include <test.h>
|
#include <test.h>
|
||||||
|
|
||||||
|
@ -34,6 +35,10 @@ int main (int argc, char** argv)
|
||||||
{
|
{
|
||||||
UnitTest t (17);
|
UnitTest t (17);
|
||||||
|
|
||||||
|
// Ensure environment has no influence.
|
||||||
|
unsetenv ("TASKDATA");
|
||||||
|
unsetenv ("TASKRC");
|
||||||
|
|
||||||
std::string ascii_text = "This is a test";
|
std::string ascii_text = "This is a test";
|
||||||
std::string utf8_text = "más sábado miércoles";
|
std::string utf8_text = "más sábado miércoles";
|
||||||
std::string utf8_wide_text = "改变各种颜色";
|
std::string utf8_wide_text = "改变各种颜色";
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue